You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 05:46:58 +02:00
fix(web): datetime display and add TZ into environment (#618)
* fix(web): timezone * doc(): update readme.md * feat(web): keep using UTC timezone in default * chore(): update doc and remove debug code * chore(): update readme.md * Move timezone into to .env.example * Run prettier check Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
import moment from 'moment';
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { browser } from '$app/env';
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { AssetResponseDto, AlbumResponseDto } from '@api';
|
||||
|
||||
type Leaflet = typeof import('leaflet');
|
||||
@ -30,6 +31,13 @@
|
||||
if (asset.exifInfo?.latitude != null && asset.exifInfo?.longitude != null) {
|
||||
await drawMap(asset.exifInfo.latitude, asset.exifInfo.longitude);
|
||||
}
|
||||
|
||||
// remove timezone when user not config PUBLIC_TZ var. Etc/UTC is used in default.
|
||||
if (asset.exifInfo?.dateTimeOriginal && !env.PUBLIC_TZ) {
|
||||
const dateTimeOriginal = asset.exifInfo.dateTimeOriginal;
|
||||
|
||||
asset.exifInfo.dateTimeOriginal = dateTimeOriginal.slice(0, dateTimeOriginal.length - 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -126,11 +134,7 @@
|
||||
<p>{moment(asset.exifInfo.dateTimeOriginal).format('MMM DD, YYYY')}</p>
|
||||
<div class="flex gap-2 text-sm">
|
||||
<p>
|
||||
{moment(
|
||||
asset.exifInfo.dateTimeOriginal
|
||||
.toString()
|
||||
.slice(0, asset.exifInfo.dateTimeOriginal.toString().length - 1)
|
||||
).format('ddd, hh:mm A')}
|
||||
{moment(asset.exifInfo.dateTimeOriginal).format('ddd, hh:mm A')}
|
||||
</p>
|
||||
<p>GMT{moment(asset.exifInfo.dateTimeOriginal).format('Z')}</p>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user