mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-21 16:51:42 +00:00
Update server settings to include host timezone for use in cron scheduler next run dates
This commit is contained in:
parent
59c7d0275c
commit
08bbf9cd9d
1 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue