Skip to content

Commit b573a9d

Browse files
committed
fix(autoreply): fix month-boundary comparison in datepicker UI widget (#134)
1 parent 592baa1 commit b573a9d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ispconfig3_autoreply/skins/classic/jquery.ui.datetime.min.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
}
7272
}, _calendar: function () {
7373
var c = this.options, e = null, k = "", n = null, l = null, j = null, h = 0, m = 0, f = this._clean(new Date(this.current)).getTime(), g = this._clean(this.minDate).getTime(), p = this._clean(this.maxDate).getTime(), q = new Date(this.date.getFullYear(), this.date.getMonth(), 0);
74-
if (q.getTime() < this.minDate.getTime()) {
74+
if (q.getTime() < this._clean(this.minDate).getTime()) {
7575
this.date.setMonth(this.minDate.getMonth())
7676
}
7777
n = this.date.getFullYear(), l = this.date.getMonth();
@@ -136,7 +136,9 @@
136136
}, _calendarUpdate: function (c, d) {
137137
switch (c) {
138138
case"months":
139-
this.date.setMonth(this.date.getMonth() + d);
139+
var targetMonth = this.date.getMonth() + d;
140+
this.date.setDate(1);
141+
this.date.setMonth(targetMonth);
140142
break;
141143
case"years":
142144
this.date.setFullYear(this.date.getFullYear() + d);
@@ -480,4 +482,4 @@
480482
}, substrOffset: function (c) {
481483
return this.substr(this.length + c, this.length)
482484
}})
483-
})(jQuery);
485+
})(jQuery);

0 commit comments

Comments
 (0)