mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Fix issue where you can't remove a time set in Configs (#1760)
* Fix issue where config times (start, end, freeze times) could not be removed
This commit is contained in:
@@ -41,11 +41,7 @@ function loadDateValues(place) {
|
||||
const timezone_string = $("#" + place + "-timezone").val();
|
||||
|
||||
const utc = convertDateToMoment(month, day, year, hour, minute);
|
||||
if (isNaN(utc.unix())) {
|
||||
$("#" + place).val("");
|
||||
$("#" + place + "-local").val("");
|
||||
$("#" + place + "-zonetime").val("");
|
||||
} else {
|
||||
if (utc.unix() && month && day && year && hour && minute) {
|
||||
$("#" + place).val(utc.unix());
|
||||
$("#" + place + "-local").val(
|
||||
utc.format("dddd, MMMM Do YYYY, h:mm:ss a z (zzz)")
|
||||
@@ -53,6 +49,10 @@ function loadDateValues(place) {
|
||||
$("#" + place + "-zonetime").val(
|
||||
utc.tz(timezone_string).format("dddd, MMMM Do YYYY, h:mm:ss a z (zzz)")
|
||||
);
|
||||
} else {
|
||||
$("#" + place).val("");
|
||||
$("#" + place + "-local").val("");
|
||||
$("#" + place + "-zonetime").val("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user