datetimepicker
datetimepicker copied to clipboard
Range between date work only with format "Y/m/d"
If I run picker with date format 'd.m.Y' - range from example ( http://xdsoft.net/jqplugins/datetimepicker/#range ) not work
I have the same problem. Range does not work with format "Y-m-d H:i:s" nor "Y-m-d". It only allows to select previous/following month, not date in that month.
Is there some workaround?
Same problem here.
When Using 'Y-m-d H:i
Today: June 11
if I FIRST select End Date (June 06), then i can select as Start Date all the days until Today (June 11)
$('#fechaAgendaInicio').datetimepicker({ lang: 'es', //format: 'Y-m-d H:i', dayOfWeekStart: 1, //step: 15, format:'Y/m/d', timepicker:false, onShow: function(ct) { this.setOptions({ maxDate: $('#fechaAgendaFin').val()?$('#fechaAgendaFin').val():false }) } });
$('#fechaAgendaFin').datetimepicker({
lang: 'es',
//format: 'Y-m-d H:i',
dayOfWeekStart: 1,
//step: 15,
format:'Y/m/d',
timepicker:false,
onShow: function(ct) {
this.setOptions({
minDate: $('#fechaAgendaInicio').val()?$('#fechaAgendaInicio').val():false
})
}
});
I think I have a solution: On file jquery.datetimepicker.js v2.2.9 change :
line 913 maxDate = _xdsoft_datetime.strtodate(options.maxDate); to: maxDate = _xdsoft_datetime.strToDateTime(options.maxDate);
line 918: minDate = _xdsoft_datetime.strtodate(options.minDate); to: minDate = _xdsoft_datetime.strToDateTime(options.minDate);
The fix by pakoArtal works for me when using the format of "d/m/Y h:i".
Change: maxDate:jQuery('#date_end').val()?jQuery('#date_end').val():false
to maxDate:jQuery('#date_end').val()?getDate(jQuery('#date_end').val()):false
and add the following function:
function getDate(datum){ fn = datum.split("-"); return fn[0]+'/'+fn[1]+'/'+fn[2]; }
for german time (d.m.Y) use this function:
function getDate(datum){ fn = datum.split("."); return fn[2]+'/'+fn[1]+'/'+fn[0]; }
I'm encountering this issue on v2.4.1. However, I'm using "m/d/Y" for the format. I've tried a couple of other formats, too, but the only one that works is "Y/m/d".
something strange , but this is working for me. format: 'd/m/Y h:m', maxDate: '-1970/01/02',
Hey guys, Here is a way
jQuery(function() { jQuery('#datetimepicker1').datetimepicker({ format:'m/d/Y', onShow:function(ct){ this.setOptions({ maxDate:jQuery('#datetimepicker2').val()?jQuery('#datetimepicker2').val():false, formatDate:'m/d/Y', }); }, timepicker:false,
});
Hey ! Yes the solution of object90 is the right way because the default format is 'Y/m/d' so we have to set again the formatDate when we call the setOptions. It works for me !
thank's... sangat membantu (indonesia).
Thanks you
it worked
format: 'd/m/Y H:i', onShow: function (ct) { this.setOptions({ maxDate: $('#date_to').val() ? getDate($('#date_to').val()) : false, formatDate: 'd/m/Y', }) }, timepicker: true
and func
function getDate(datum) { fn = datum.split(" "); fn0 = fn[0].split("/"); fn1 = fn[1].split(":"); return fn0[0] + '/' + fn0[1] + '/' + fn0[2]; }
Hey guys, Here is a way
jQuery(function() { jQuery('#datetimepicker1').datetimepicker({ format:'m/d/Y', onShow:function(ct){ this.setOptions({ maxDate:jQuery('#datetimepicker2').val()?jQuery('#datetimepicker2').val():false, formatDate:'m/d/Y', }); }, timepicker:false,
});
Gracias :)