mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat(web): seconds and milliseconds in timestamps (#20337)
* fix(web): seconds in timestamps * changed date-input step to provide millisecond precision
This commit is contained in:
parent
eee793bfe4
commit
9838634067
3 changed files with 4 additions and 2 deletions
|
|
@ -307,6 +307,7 @@
|
||||||
weekday: 'short',
|
weekday: 'short',
|
||||||
hour: 'numeric',
|
hour: 'numeric',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
|
second: '2-digit',
|
||||||
timeZoneName: timeZone ? 'longOffset' : undefined,
|
timeZoneName: timeZone ? 'longOffset' : undefined,
|
||||||
},
|
},
|
||||||
{ locale: $locale },
|
{ locale: $locale },
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
|
|
||||||
const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||||
|
|
||||||
let selectedDate = $state(initialDate.toFormat("yyyy-MM-dd'T'HH:mm"));
|
let selectedDate = $state(initialDate.toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"));
|
||||||
// Use a fixed modern date to calculate stable timezone offsets for the list
|
// Use a fixed modern date to calculate stable timezone offsets for the list
|
||||||
// This ensures that the offsets shown in the combobox are always current,
|
// This ensures that the offsets shown in the combobox are always current,
|
||||||
// regardless of the historical date selected by the user.
|
// regardless of the historical date selected by the user.
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
const { offsetMinutes, offsetFormat: zoneOffsetAtDate } = getModernOffsetForZoneAndDate(zone, date);
|
const { offsetMinutes, offsetFormat: zoneOffsetAtDate } = getModernOffsetForZoneAndDate(zone, date);
|
||||||
// For validity, we still need to check if the exact date/time exists in the *original* timezone (for gaps/overlaps).
|
// For validity, we still need to check if the exact date/time exists in the *original* timezone (for gaps/overlaps).
|
||||||
const dateForValidity = DateTime.fromISO(date, { zone });
|
const dateForValidity = DateTime.fromISO(date, { zone });
|
||||||
const valid = dateForValidity.isValid && date === dateForValidity.toFormat("yyyy-MM-dd'T'HH:mm");
|
const valid = dateForValidity.isValid && date === dateForValidity.toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
|
||||||
return {
|
return {
|
||||||
value: zone,
|
value: zone,
|
||||||
offsetMinutes,
|
offsetMinutes,
|
||||||
|
|
|
||||||
|
|
@ -34,4 +34,5 @@
|
||||||
}
|
}
|
||||||
onkeydown?.(e);
|
onkeydown?.(e);
|
||||||
}}
|
}}
|
||||||
|
step=".001"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue