Bound the check date picker to today (32.8 point 3)
This commit is contained in:
1 parent
1ca521dad4
commit
2018376afe
1 file changed
+6
-1
@@ -508,7 +508,12 @@ function updateDuePreview() {
|
||||
|
||||
function setCheckDate() {
|
||||
const checkedAt = document.querySelector("#checked-at");
|
||||
checkedAt.value = formatLocalDate(new Date());
|
||||
const today = formatLocalDate(new Date());
|
||||
checkedAt.value = today;
|
||||
// The server refuses a check date in the future, because a check that has not
|
||||
// happened yet cannot be recorded, so the date picker is bounded to today as
|
||||
// well (section 32.8 point 3).
|
||||
checkedAt.max = today;
|
||||
updateDuePreview();
|
||||
checkedAt.addEventListener("change", updateDuePreview);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user