Skip to content

Commit d66d211

Browse files
committed
Fixed pm (previous month) and nm (next month) so that they are only disabled when min or max
occurs in the current month being shown.
1 parent 8256c99 commit d66d211

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/dateinput/dateinput.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,16 +580,25 @@
580580
// today
581581
} else if (isSameDay(now, date)) {
582582
a.attr("id", css.today);
583-
}
583+
}
584+
585+
// disabled
586+
if (min && date < min) {
587+
pm.addClass(css.disabled);
588+
}
589+
590+
if (max && date > max) {
591+
nm.addClass(css.disabled);
592+
}
584593
}
585-
594+
586595
// disabled
587596
if (min && date < min) {
588-
a.add(pm).addClass(css.disabled);
597+
a.addClass(css.disabled);
589598
}
590599

591600
if (max && date > max) {
592-
a.add(nm).addClass(css.disabled);
601+
a.addClass(css.disabled);
593602
}
594603

595604
a.attr("href", "#" + num).text(num).data("date", date);

0 commit comments

Comments
 (0)