mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-21 12:08:38 +02:00
Update server settings to include host timezone for use in cron scheduler next run dates
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user