I have this code in my view (JS):
$("#mydivelement").timepicker();
Instead of only timepicker, it displays datetimepicker. I have datepicker defaults set in Layout page if it matters:
$.datepicker.setDefaults({
dateFormat: 'dd/mm/yy',
yearRange: '1930:2012',
changeYear: true,
changeMonth: true,
autoSize: true,
showAnim: 'slideDown',
firstDay: 1
});
Update: Used Library- jquery-ui-timepicker-addon.js
I have this code in my view (JS):
$("#mydivelement").timepicker();
Instead of only timepicker, it displays datetimepicker. I have datepicker defaults set in Layout page if it matters:
$.datepicker.setDefaults({
dateFormat: 'dd/mm/yy',
yearRange: '1930:2012',
changeYear: true,
changeMonth: true,
autoSize: true,
showAnim: 'slideDown',
firstDay: 1
});
Update: Used Library- jquery-ui-timepicker-addon.js
Share Improve this question edited Jun 6, 2012 at 13:06 karaxuna asked Jun 6, 2012 at 12:35 karaxunakaraxuna 26.9k13 gold badges86 silver badges119 bronze badges 5-
just an idea: why do you set
dateFormat
when you want a timepicker... perhaps that could be the problem. – evotopid Commented Jun 6, 2012 at 12:38 - It's datepicker defaults, not timepicker – karaxuna Commented Jun 6, 2012 at 12:39
- Oh... sorry, I just didn't read exactly... (now it makes sense) :D – evotopid Commented Jun 6, 2012 at 12:41
-
What
timepicker
library are you using? – Ayman Safadi Commented Jun 6, 2012 at 13:04 - jquery-ui-timepicker-addon.js – karaxuna Commented Jun 6, 2012 at 13:05
1 Answer
Reset to default 5You are missing to add {}
to inside of .timepicker()
Jquery
$(function() {
$( "#mydivelement" ).datepicker({
dateFormat: 'dd/mm/yy',
yearRange: '1930:2012',
changeYear: true,
changeMonth: true,
autoSize: true,
showAnim: 'slideDown',
firstDay: 1
});
$('#timepicker').timepicker({}); // it shows only timepicker without datepicker
});
jsFiddle example