javascript - JQuery Datepicker date is captured only when the day is clicked -
ran weird problem jquery datepicker. i've set option changemonth: true enable month change.
say, if datepicker displays date 02/05/2013 , when change month april(not clicking on day in control), date gets displayed 02/04/2013. when date control, end getting old month value instead of newly selected one.
code:
$('#uxstartdatetime').datetimepicker({ timeformat: "hh:mm tt", dateformat: "dd/mm/yy", showbuttonpanel: false, changemonth: true, changeyear: true }); //getting date var startdate = $('#uxstartdatetime').datetimepicker('getdate'); //formatting date send via ajax c# startdate = startdate.getfullyear() + "-" + (startdate.getmonth() + 1) + "-" + startdate.getdate() + " " + startdate.gethours() + ":" + startdate.getminutes();
is there wrong method or known issue?
that expected datepicker behavior, adeneo pointed out in comment. if want change this, have write method fired on change of month.
$('.ui-datepicker-month').change(function () { // if there value in controller, change });
i'll leave actual logic of adding/subtracting months date you.
Comments
Post a Comment