Skip to content

Commit

Permalink
Merge e400c72 into 0b5b4c0
Browse files Browse the repository at this point in the history
  • Loading branch information
jaweesner committed May 31, 2019
2 parents 0b5b4c0 + e400c72 commit 672ee05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ DOM.extend("input[type=date]", {
if (!dateValue) {
value = "";
} else {
const min = new Date(this.get("min") + "T00:00");
const max = new Date(this.get("max") + "T00:00");
const min = new Date((this.get("min") || "?") + "T00:00");
const max = new Date((this.get("max") || "?") + "T00:00");

if (dateValue < min) {
value = formatLocalDate(min);
Expand Down
8 changes: 4 additions & 4 deletions src/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ DOM.extend("dateinput-picker", {
const month = dateValue.getMonth();
const date = dateValue.getDate();
const year = dateValue.getFullYear();
const min = new Date(this._parentInput.get("min") + "T00:00");
const max = new Date(this._parentInput.get("max") + "T00:00");
const min = new Date((this._parentInput.get("min") || "?") + "T00:00");
const max = new Date((this._parentInput.get("max") || "?") + "T00:00");
const iterDate = new Date(year, month, 1);
// move to beginning of the first week in current month
iterDate.setDate(1 - iterDate.getDay() - ampm(1, iterDate.getDay() === 0 ? 7 : 0));
Expand Down Expand Up @@ -157,8 +157,8 @@ DOM.extend("dateinput-picker", {
_invalidateMonths(dateValue) {
const month = dateValue.getMonth();
const year = dateValue.getFullYear();
const min = new Date(this._parentInput.get("min") + "T00:00");
const max = new Date(this._parentInput.get("max") + "T00:00");
const min = new Date((this._parentInput.get("min") || "?") + "T00:00");
const max = new Date((this._parentInput.get("max") || "?") + "T00:00");
const iterDate = new Date(year, month, 1);

this._calendarMonths.findAll("td").forEach((day, index) => {
Expand Down

0 comments on commit 672ee05

Please sign in to comment.