add comment to explain why we are avoiding the dateString constructor option for our Date object
This commit is contained in:
parent
49acf5d831
commit
cf3c6a015f
1 changed files with 1 additions and 0 deletions
|
@ -83,6 +83,7 @@
|
|||
this.rawSelectedDate = $(`input[name='${this.fieldName}']`).val();
|
||||
|
||||
if (this.rawSelectedDate.length) {
|
||||
// Construct Date object manually to avoid buggy dateString support within Date constructor
|
||||
const dateArray = this.rawSelectedDate.split('-').map(v => parseInt(v, 10));
|
||||
const dateObj = new Date(dateArray[0], dateArray[1] - 1, dateArray[2]);
|
||||
this.displayedDate = $.datepicker.formatDate('M d, yy', dateObj);
|
||||
|
|
Loading…
Reference in a new issue