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,13 +0,0 @@
import { Duration } from 'luxon';
/**
* Convert time like `01:02:03.456` to seconds.
*/
export function timeToSeconds(time: string) {
const parts = time.split(':');
parts[2] = parts[2].split('.').slice(0, 2).join('.');
const [hours, minutes, seconds] = parts.map(Number);
return Duration.fromObject({ hours, minutes, seconds }).as('seconds');
}