Keith-Wood DatePicker onSelect not working when rangeselect is true
I'm using Keith-Wood DatePicker Plugin and adding below code in my project
- $('#ArrivalDate').datepick({
- changeMonth: false,
- dateFormat: 'dd M yyyy',
- selectOtherMonths: true,
- showAnim: false,
- showOtherMonths: true,
- monthsToShow: 2,
- minDate: 0,
- maxDate: '2Y-1',
- rangeSelect: true,
- onSelect: function (dates) {
- alert('working');
- var date1 = $.datepick.formatDate('dd M yyyy', dates[0]);
- var date2 = $.datepick.formatDate('dd M yyyy', dates[1]);
-
- $("#ArrivalDate.datepicker").val(date1);
- $("#DepartureDate.datepicker").val(date2);
- },
- });
Currently, facing following issues. 1) when I select first date it shows min & Max dates in ArrivalDate Text box, however, onClose it working fine. 2) Alert is not firing as onSelect is not working.
Exact requirement. if onSelect starts working then I want to compare first and second dates.
Thanks you in advance.