notifications: timezone fix + configurable site timezone

This commit is contained in:
2026-07-30 15:09:06 -04:00
parent 4610108a0c
commit ce550aefc6
8 changed files with 223 additions and 40 deletions

View File

@@ -231,13 +231,17 @@ function openEventFromTooltip(evt) {
function formatDate(dateStr) {
if (!dateStr) return ''
return new Date(dateStr).toLocaleDateString('en-US', {
// allDay events carry a site-local date-only value (YYYY-MM-DD). Build the
// Date from local parts so it is not shifted a day by UTC-midnight parsing.
const parts = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateStr)
const date = parts
? new Date(Number(parts[1]), Number(parts[2]) - 1, Number(parts[3]))
: new Date(dateStr)
return date.toLocaleDateString('en-US', {
weekday: 'short',
year: 'numeric',
month: 'short',
day: 'numeric',
hour: '2-digit',
minute: '2-digit'
day: 'numeric'
})
}
</script>