Update server settings to include host timezone for use in cron scheduler next run dates
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Build and Push Docker Image / build (push) Has been cancelled
Integration Test / build and test (push) Has been cancelled
Run Unit Tests / Run Unit Tests (push) Has been cancelled

This commit is contained in:
advplyr 2026-07-19 17:31:00 -05:00
parent 59c7d0275c
commit 08bbf9cd9d

View file

@ -260,6 +260,18 @@ class ServerSettings {
}
}
/**
* Host timezone used by cron schedulers (not persisted in settings)
* @returns {string} IANA timezone name, e.g. "America/New_York"
*/
static getHostTimeZone() {
try {
return Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'
} catch {
return 'UTC'
}
}
toJSONForBrowser() {
const json = this.toJSON()
delete json.tokenSecret
@ -268,6 +280,7 @@ class ServerSettings {
delete json.authOpenIDMobileRedirectURIs
delete json.authOpenIDGroupClaim
delete json.authOpenIDAdvancedPermsClaim
json.timeZone = ServerSettings.getHostTimeZone()
return json
}