From 251f10d1059530bf2331f78cf764c09bca3963d7 Mon Sep 17 00:00:00 2001 From: Solomon Cammack Date: Wed, 1 Jan 2025 23:31:51 +0000 Subject: [PATCH] Fix a few date issues & logic for badges --- .../website/dashboard/AdvancedDateEditor.vue | 15 +++++++++------ .../website/schedule/TimezoneSwapper.vue | 2 +- website/src/utils/content-utils.js | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/website/src/components/website/dashboard/AdvancedDateEditor.vue b/website/src/components/website/dashboard/AdvancedDateEditor.vue index e4e0411b..ba366f34 100644 --- a/website/src/components/website/dashboard/AdvancedDateEditor.vue +++ b/website/src/components/website/dashboard/AdvancedDateEditor.vue @@ -21,18 +21,21 @@ class="mb-2" name="datetime-editor" type="datetime-local" + :min="earliestTime ? safeTime(earliestTime, '{year}-{iso-month}-{date-pad}T{hour-pad}:{minute-pad}') : null" + :max="latestTime ? safeTime(latestTime, '{year}-{iso-month}-{date-pad}T{hour-pad}:{minute-pad}') : null" + step="300" :model-value="temporaryTime || safeSavedTime" @update:model-value="(val) => temporaryTime = val" /> -
+
- This match must start at or after {{ formatTime(earliestTime) }} + This match must start at or after {{ safeTime(earliestTime, "{day-short} {date-ordinal} {month-short} {year} {time} {tz}") }}
- This match must start at or before {{ formatTime(latestTime) }} + This match must start at or before {{ safeTime(latestTime, "{day-short} {date-ordinal} {month-short} {year} {time} {tz}") }}
- This match must start between {{ formatTime(earliestTime) }} and
{{ formatTime(latestTime) }} + This match must start between {{ safeTime(earliestTime, "{day-short} {date-ordinal} {month-short} {year} {time} {tz}") }} and
{{ safeTime(latestTime, "{day-short} {date-ordinal} {month-short} {year} {time} {tz}") }}
@@ -129,13 +132,13 @@ export default { }, methods: { formatTime, spacetime, - safeTime(timeString) { + safeTime(timeString, customFormat) { if (!timeString || typeof timeString !== "string") return null; return this.formatTime( timeString, { tz: this.editTimeInSiteTimezone ? this.siteTimezone : this.localTimezone, - format: SafeTimeFormat, + format: customFormat || SafeTimeFormat, use24HourTime: this.$store.state.use24HourTime } ); } diff --git a/website/src/components/website/schedule/TimezoneSwapper.vue b/website/src/components/website/schedule/TimezoneSwapper.vue index 5e2ab2b4..e8ce848e 100644 --- a/website/src/components/website/schedule/TimezoneSwapper.vue +++ b/website/src/components/website/schedule/TimezoneSwapper.vue @@ -1,7 +1,7 @@