bootstrap datetime picker with 12 hour clock not displaying the meridian(am or pm) in rails?

混江龙づ霸主 提交于 2019-12-01 10:45:19
$('#datetimepicker1').datetimepicker({
             format : 'DD/MM/YYYY hh:mm a'   
        });

gives DD/MM/YYYY hh:mm am

or

$('#datetimepicker1').datetimepicker({
             format : 'DD/MM/YYYY hh:mm A'   
        });

gives DD/MM/YYYY hh:mm AM

I can´t test it at the moment. But id should be

format : 'DD/MM/YYYY hh:mm A'

or

format : 'DD/MM/YYYY hh:mm a'

for big or small pm.

You can use

format: 'DD-MM-YYYY hh:mm A'

or

format: 'DD-MM-YYYY hh:mm:ss A'

or

format: 'DD-MM-YYYY - hh:mm:ss A'

or

format: 'DD-MM-YYYY :: hh:mm:ss A'

or

any other such possible combination. Here the A in the end of format is responsible for showing AM or PM

Mustufa

any of the above solution is not worked for me I have tried this, hope this help anyone

 format: 'dd/mm/yyyy hh:ii p'

where

  • dd - Date
  • mm - month
  • yyyy - year
  • hh - hour
  • ii - minute
  • p - show am/pm

This link is very useful

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!