add comment to explain why we are avoiding the dateString constructor option for our Date object

This commit is contained in:
Mike Greiling 2017-01-02 15:03:16 -06:00
parent 49acf5d831
commit cf3c6a015f

View file

@ -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);