最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how to hide second and millisecond from jquery ui datetimepicker - Stack Overflow

programmeradmin4浏览0评论

I use jquery-datetimepicker in this link my simple code like this $(".datetimepicker").datetimepicker();

but the GUI appear like this

I want date calender and time by (Hours and Minutes) only appear in the widget I trying this code but no effects.

$(".datetimepicker").datetimepicker({
dateFormat: 'dd-mm-yy',
timeFormat: 'hh:mm tt',
showTimePicker: false, 
showSecond:false,
showMillisec:false,
showMicrosec:false,
showTimezone:false
});

I use jquery-datetimepicker in this link my simple code like this $(".datetimepicker").datetimepicker();

but the GUI appear like this

I want date calender and time by (Hours and Minutes) only appear in the widget I trying this code but no effects.

$(".datetimepicker").datetimepicker({
dateFormat: 'dd-mm-yy',
timeFormat: 'hh:mm tt',
showTimePicker: false, 
showSecond:false,
showMillisec:false,
showMicrosec:false,
showTimezone:false
});
Share Improve this question asked Apr 9, 2015 at 6:39 AhmedAhmed 5561 gold badge4 silver badges22 bronze badges 1
  • I tried it on JSFiddle. Don't be scared it's without CSS. But as you can see it works fine. jsfiddle.net/ujz4gt95 – Baximilian Commented Apr 9, 2015 at 7:10
Add a comment  | 

2 Answers 2

Reset to default 16

the problem is jquery-ui-timepicker-addon.css file not loaded correctly

it was like this

<link href='datetimepicker/src/jquery-ui-timepicker-addon.css'/>

I forgot to add link type

<link type='text/css' rel='stylesheet' href='datetimepicker/src/jquery-ui-timepicker-addon.css' />

it's working now . @zedd thank you very much . you put my hand in the problem point

The documentation says that a null value for showMillisec and micro will auto detect the controls from timeFormat, so try to set them to null, or not setting them at all

The default of null will use detection from timeFormat.

发布评论

评论列表(0)

  1. 暂无评论