Open mealinux opened 5 years ago
this is what i use in the scenario, looks longer but more of a hack
var today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
$('#startDate').datetimepicker({
footer: true,
modal: true,
format: 'dd-mm-yyyy HH:MM:ss',
uiLibrary: 'bootstrap',
iconsLibrary: 'fontawesome',
datepicker : {
minDate: today,
disableDates: function (date) {
if($('#endDate').val() !== ''){
var parts = $('#endDate').val().split('-');
const currentDate = new Date(parts[2].split(' ')[0], parts[1] - 1, parts[0]);
return date <= currentDate ? true : false;
}
return true;
}
}
});
$('#endDate').datetimepicker({
footer: true,
modal: true,
format: 'dd-mm-yyyy HH:MM:ss',
uiLibrary: 'bootstrap',
iconsLibrary: 'fontawesome',
datepicker: {
disableDates: function (date) {
if($('#startDate').val() !== '') {
var parts = $('#startDate').val().split('-');
const currentDate = new Date(parts[2].split(' ')[0], parts[1] - 1, parts[0]);
return date >= currentDate ? true : false;
}
return true;
}
}
});
Nope. This does not work correctly with BooStrap5. And looks like this project does not have any active support.
there is datepicker range but no datetimepicker range so with timepicker?