提交 e73cfbd4 编写于 作者: J Jacob Schatz

Fix date bug in JS that makes dates not work with strings

上级 6c26fb35
......@@ -168,6 +168,7 @@ class DueDateSelectors {
initMilestoneDatePicker() {
$('.datepicker').each(function() {
const $datePicker = $(this);
const [y, m, d] = $datePicker.val().split('-');
const calendar = new Pikaday({
field: $datePicker.get(0),
theme: 'gitlab-theme animate-picker',
......@@ -177,7 +178,8 @@ class DueDateSelectors {
$datePicker.val(dateFormat(new Date(dateText), 'yyyy-mm-dd'));
}
});
calendar.setDate(new Date($datePicker.val()));
calendar.setDate(new Date(y, m-1, d));
$datePicker.data('pikaday', calendar);
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册