Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to hide second and millisecond from jquery ui datetimepicker

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

but the GUI appear like this

enter image description here

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
});
like image 391
Ahmed Avatar asked Apr 09 '15 06:04

Ahmed


2 Answers

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

like image 54
Ahmed Avatar answered Oct 10 '22 18:10

Ahmed


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.

like image 2
BobbyTables Avatar answered Oct 10 '22 17:10

BobbyTables