mirror of
https://github.com/immich-app/immich.git
synced 2025-11-18 12:33:29 -05: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
@ -307,6 +307,7 @@
|
||||
weekday: 'short',
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
timeZoneName: timeZone ? 'longOffset' : undefined,
|
||||
},
|
||||
{ locale: $locale },
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
|
||||
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
|
||||
// This ensures that the offsets shown in the combobox are always current,
|
||||
// regardless of the historical date selected by the user.
|
||||
@ -106,7 +106,7 @@
|
||||
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).
|
||||
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 {
|
||||
value: zone,
|
||||
offsetMinutes,
|
||||
|
||||
@ -34,4 +34,5 @@
|
||||
}
|
||||
onkeydown?.(e);
|
||||
}}
|
||||
step=".001"
|
||||
/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user