javascript - Identify date format in jquery and set it as default in a jquery datepicker -
javascript - Identify date format in jquery and set it as default in a jquery datepicker -
// have installmentdate object object
var installmentdate = installment.installmentdate; alert(json.stringify(installmentdate));
using json.stringify(installmentdate) shows
{"date":3, "day":5, "hours":0, "minutes":0, "month":9, "nanos":0, "seconds":0, "time":1412274600000, "timezoneoffset":-330, "year":114}
please identify in format in. , trying set date default jquery datepicker these next ways tried , nil works
$('#duedate').datepicker('setdate', installmentdate); $('#duedate').datepicker('setdate', new date((installment.installmentdate)); $('#duedate').val(installmentdate);
your date not have proper format. according documentation, here possible options:
the new date may date object or string in current date format (e.g., "01/26/2009"), number of days today (e.g., +7) or string of values , periods ("y" years, "m" months, "w" weeks, "d" days, e.g., "+1m +7d"), or null clear selected date.
you might need reformat installmentdate
.
javascript jquery datepicker
Comments
Post a Comment