fix(server): fallback to local timezone when rendering storage template (#4317)

This commit is contained in:
Jason Rasmussen
2023-10-03 14:05:44 -04:00
committed by GitHub
parent e5f704cf3b
commit 818005fcb5

View File

@@ -235,7 +235,9 @@ export class StorageTemplateService {
filetypefull: asset.type == AssetType.IMAGE ? 'IMAGE' : 'VIDEO',
};
const dt = luxon.DateTime.fromJSDate(asset.fileCreatedAt, { zone: asset.exifInfo?.timeZone || undefined });
const systemTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const zone = asset.exifInfo?.timeZone || systemTimeZone;
const dt = luxon.DateTime.fromJSDate(asset.fileCreatedAt, { zone });
const dateTokens = [
...supportedYearTokens,