Use browser timezone if not specified in config

This commit is contained in:
lucas_nz 2023-04-23 14:27:05 +12:00 committed by GitHub
parent 8535213ad9
commit a44d033bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,7 @@ export const formatUnixTimestampToDateTime = (unixTimestamp: number, config: Dat
// use strftime_fmt if defined in config file
if (strftime_fmt) {
const strftime_locale = strftime.timezone(getUTCOffset(date, timezone)).localizeByIdentifier(locale);
const strftime_locale = strftime.timezone(getUTCOffset(date, timezone || Intl.DateTimeFormat().resolvedOptions().timeZone)).localizeByIdentifier(locale);
return strftime_locale(strftime_fmt, date);
}