mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-08-26 05:14:00 +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() {
|
toJSONForBrowser() {
|
||||||
const json = this.toJSON()
|
const json = this.toJSON()
|
||||||
delete json.tokenSecret
|
delete json.tokenSecret
|
||||||
@@ -268,6 +280,7 @@ class ServerSettings {
|
|||||||
delete json.authOpenIDMobileRedirectURIs
|
delete json.authOpenIDMobileRedirectURIs
|
||||||
delete json.authOpenIDGroupClaim
|
delete json.authOpenIDGroupClaim
|
||||||
delete json.authOpenIDAdvancedPermsClaim
|
delete json.authOpenIDAdvancedPermsClaim
|
||||||
|
json.timeZone = ServerSettings.getHostTimeZone()
|
||||||
return json
|
return json
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user