mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-04 13:47:37 +02:00
Timezone fix (#19293)
* Frontend timezone fixes Last recording date timezone was being applied twice, so it displayed the wrong date Also, TZDate from react-day-picker could have been behaving incorrectly at times without a full date string * Ensure returned day is parsed as midnight in specified timezone
This commit is contained in:
parent
0b7a33d670
commit
898d1de875
@ -50,7 +50,7 @@ export default function ReviewActivityCalendar({
|
||||
}
|
||||
|
||||
const parts = date.split("-");
|
||||
const cal = new TZDate(date, timezone);
|
||||
const cal = new TZDate(date + "T00:00:00", timezone);
|
||||
|
||||
cal.setFullYear(
|
||||
parseInt(parts[0]),
|
||||
@ -70,7 +70,7 @@ export default function ReviewActivityCalendar({
|
||||
}
|
||||
|
||||
const parts = date.split("-");
|
||||
const cal = new TZDate(date, timezone);
|
||||
const cal = new TZDate(date + "T00:00:00", timezone);
|
||||
|
||||
cal.setFullYear(
|
||||
parseInt(parts[0]),
|
||||
|
@ -13,6 +13,7 @@ import { FrigateConfig } from "@/types/frigateConfig";
|
||||
import { useFormattedTimestamp, useTimezone } from "@/hooks/use-date-utils";
|
||||
import { RecordingsSummary } from "@/types/review";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TZDate } from "react-day-picker";
|
||||
|
||||
type CameraStorage = {
|
||||
[key: string]: {
|
||||
@ -66,9 +67,10 @@ export default function StorageMetrics({
|
||||
const earliestDate = useMemo(() => {
|
||||
const keys = Object.keys(recordingsSummary || {});
|
||||
return keys.length
|
||||
? new Date(keys[keys.length - 1]).getTime() / 1000
|
||||
? new TZDate(keys[keys.length - 1] + "T00:00:00", timezone).getTime() /
|
||||
1000
|
||||
: null;
|
||||
}, [recordingsSummary]);
|
||||
}, [recordingsSummary, timezone]);
|
||||
|
||||
const timeFormat = config?.ui.time_format === "24hour" ? "24hour" : "12hour";
|
||||
const format = useMemo(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user