Employed a regular expression pattern in the PeriodConverter to check the period format first.

This commit is contained in:
2020-07-23 22:13:17 +08:00
parent d88d3942d2
commit 25383a3ae6
3 changed files with 7 additions and 5 deletions

View File

@ -30,7 +30,7 @@ $(function () {
$("#button-period-day")
.on("click", function () {
window.location = $("#period-url").val()
.replace("period-spec", $("#day-picker").val());
.replace("0000-00-00", $("#day-picker").val());
});
$("#period-start")
.on("change", function () {
@ -43,7 +43,7 @@ $(function () {
$("#button-period-custom")
.on("click", function () {
window.location = $("#period-url").val().replace(
"period-spec",
"0000-00-00",
$("#period-start").val() + "-" + $("#period-end").val());
});
@ -80,7 +80,7 @@ function monthPickerChanged(newDate) {
periodSpec = year + "-" + month;
}
window.location = $("#period-url").val()
.replace("period-spec", periodSpec);
.replace("0000-00-00", periodSpec);
}
/**