Skip to content

Commit 1e60bb7

Browse files
committed
Change day value automatically based on days of specified month and year
1 parent d70d6a4 commit 1e60bb7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

datetime-jsp/datetime.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ function setCurrentUtcDate() {
4747
}
4848
function getDaysInMonth() {
4949
day.max = new Date(year.value, month.value, 0).getDate();
50+
if (day.value > day.max) {
51+
day.value = day.max;
52+
}
5053
}

0 commit comments

Comments
 (0)