summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-01-02 15:03:16 -0600
committerMike Greiling <mike@pixelcog.com>2017-01-02 15:08:50 -0600
commitcf3c6a015f9ba644f1cec10319b247ef04114189 (patch)
tree808a632f239eb8e96f2b27fe76f741ab9d0475bf
parent49acf5d831b0699d60689b7d86528f4970091b49 (diff)
downloadgitlab-ce-fix-timezone-due-date-picker.tar.gz
add comment to explain why we are avoiding the dateString constructor option for our Date objectfix-timezone-due-date-picker
-rw-r--r--app/assets/javascripts/due_date_select.js.es61
1 files changed, 1 insertions, 0 deletions
diff --git a/app/assets/javascripts/due_date_select.js.es6 b/app/assets/javascripts/due_date_select.js.es6
index 6ea8adb7c7b..201f9fdc3fe 100644
--- a/app/assets/javascripts/due_date_select.js.es6
+++ b/app/assets/javascripts/due_date_select.js.es6
@@ -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);