When endate
is selected, the value of edate
works fine, however I want to add one day to selected date before sending request to controller.
code to get value from datepicker:
var edate = $("#in_edate").datepicker({ dateFormat: 'dd/mm/yy' }).val();
Code to add one day to current value if not null:
if (edate != null) edate = moment(edate).add(1, 'days').toDate();
the problem is that edate
return like Date {Thu Mar 03 2016 00:00:00 GMT+0800 (Malay Peninsula Standard Time)}
and also does not add one day ?
I do not understand why date format became long format and why one day is not added to the selected date.