fix(web): timezone handling in search filter (#7384)

This commit is contained in:
Michel Heusschen 2024-02-24 21:23:30 +01:00 committed by GitHub
parent 57758293e5
commit 6ec4c5874b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 29 additions and 27 deletions

View file

@ -1,4 +1,4 @@
import { timeToSeconds } from './time-to-seconds';
import { timeToSeconds } from './date-time';
describe('converting time to seconds', () => {
it('parses hh:mm:ss correctly', () => {

View file

@ -1,4 +1,4 @@
import { Duration } from 'luxon';
import { DateTime, Duration } from 'luxon';
/**
* Convert time like `01:02:03.456` to seconds.
@ -11,3 +11,7 @@ export function timeToSeconds(time: string) {
return Duration.fromObject({ hours, minutes, seconds }).as('seconds');
}
export function parseUtcDate(date: string) {
return DateTime.fromISO(date, { zone: 'UTC' }).toUTC();
}