[英]Time Format not working for dateTimePicker
I downloaded the javascript and required css files from http://trentrichardson.com/examples/timepicker/ 我从http://trentrichardson.com/examples/timepicker/下载了javascript和所需的CSS文件
I am getting the date and time but it is in a 24hr format and I want it to be in a 12 hr format with am/pm. 我正在获取日期和时间,但它是24小时格式,我希望它是带有am / pm的12小时格式。
I tried this: 我尝试了这个:
$('.emltdp-emltd-test').datetimepicker({
timeFormat: 'hh:mm tt',
});
but its not working. 但它不起作用。
I don't see anything wrong with your code, and I can verify that it should work if it matches what you've posted. 我看不出有什么毛病你的代码,我可以验证它是否匹配你贴什么它应该工作。 Just make sure you don't have any spelling or capitalization mistakes in your actual code.
只要确保您的实际代码中没有任何拼写或大写错误即可。
$(function(){ $('.emltdp-emltd-test').datetimepicker({ timeFormat: 'hh:mm tt', }); })
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script> <script src="http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js"></script> <link rel="stylesheet" href="http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.css" /> <input class="emltdp-emltd-test" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.