$("#dateOff1").change(function () {
currentDate = this.value;
currentDate = new Date(currentDate);
- alert(currentDate);
+ d = currentDate.getDate();
+ m = currentDate.getMonth() + 1;
+ y = currentDate.getFullYear();
+ requiredDate = y + '-' + m + '-' + d;
+ alert(requiredDate);
});
$("#date1").datepicker({
minDate: 2,
$("#dateOff1").change(function () {
currentDate = this.value;
currentDate = new Date(currentDate);
- alert(currentDate);
+ d = currentDate.getDate();
+ m = currentDate.getMonth() + 1;
+ y = currentDate.getFullYear();
+ requiredDate = y + '-' + m + '-' + d;
+ alert(requiredDate);
});
$("#date1").datepicker({
minDate: 2,