Hey guys! I have the following code (not working as to be expected)
var fullDate = new Date();
var twoDigitMonth = ((fullDate.getMonth().length+1) === 1)? (fullDate.getMonth()+1) : '0' + (fullDate.getMonth()+1);
var currentDate = fullDate.getDate() + "/" + twoDigitMonth + "/" + fullDate.getFullYear();
jQuery(document).ready(function() {
jQuery('#desde').datepicker({
startDate: currentDate,
language: "es",
autoclose: true,
todayHighlight: true,
keyboardNavigation: false,
});
jQuery('#hasta').datepicker({
setStartDate: jQuery('#desde').datepicker('getFormattedDate'),
language: "es",
autoclose: true,
todayHighlight: true,
keyboardNavigation: false,
});
}
The idea is to have 2 datepickers, where the first datepicker value
should set the minimum date to be selected from the 2nd. its imperative
that you cannot select dates from the past (the minimum date from the
first datepicker must be "today" and the minimum date from the second
datepicker must be first-datepicker value)
due to restrictions of the design, it cannot be a date-range picker.
Any cues or pointers around?