// I have installmentDate which is an object object
var installmentDate = installment.installmentDate;
alert(JSON.stringify(installmentDate));
Using JSON.stringify(installmentDate) it shows
{"date":3, "day":5, "hours":0, "minutes":0, "month":9, "nanos":0, "seconds":0, "time":1412274600000, "timezoneoffset":-330, "year":114}
Please identify in which format this is in. And I am trying to set this date as default to a jquery datepicker These are the following ways I tried and nothing works
$('#dueDate').datepicker('setDate', installmentDate);
$('#dueDate').datepicker('setDate', new Date((installment.installmentDate));
$('#dueDate').val(installmentDate);
Your date does not have the proper format. According to the documentation, here are the possible options:
The new date may be a Date object or a string in the current date format (e.g., "01/26/2009"), a number of days from today (e.g., +7) or a string of values and periods ("y" for years, "m" for months, "w" for weeks, "d" for days, e.g., "+1m +7d"), or null to clear the selected date.
You might need to reformat your installmentDate
.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加