Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 7395914

Browse files
committed
fix(datepicker): min-date validation is incorrect in GMT+X timezones
Fixes #11963
1 parent 4afba57 commit 7395914

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@
133133
"node": ">=10",
134134
"npm": ">=6"
135135
}
136-
}
136+
}

src/components/datepicker/js/dateUtil.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@
310310
}
311311

312312
/**
313-
* @param {Date} value
314-
* @return {boolean|boolean}
313+
* @param {Date} value date in local timezone
314+
* @return {Date} date with local timezone removed
315315
*/
316316
function removeLocalTzAndReparseDate(value) {
317317
var dateValue, formattedDate;

src/components/datepicker/js/datepickerDirective.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@
10011001
var self = this;
10021002
var timezone = this.$mdUtil.getModelOption(this.ngModelCtrl, 'timezone');
10031003

1004-
if (this.dateUtil.isValidDate(value)) {
1004+
if (this.dateUtil.isValidDate(value) && timezone != null) {
10051005
this.date = this.dateUtil.removeLocalTzAndReparseDate(value);
10061006
} else {
10071007
this.date = value;

0 commit comments

Comments
 (0)