blakeblackshear.frigate/web/src/hooks/use-date-utils.ts
Nicolas Mowen 9801534f11
Implement Review Filters (#10031)
* Get cameras filter working

* Implement label and review filters

* Fix

* Add time selection

* Cleanup

* Cleanup

* cleanup

* remove commented code

* Fix
2024-02-25 13:04:44 -06:00

13 lines
369 B
TypeScript

import { formatUnixTimestampToDateTime } from "@/utils/dateUtil";
import { useMemo } from "react";
export function useFormattedTimestamp(timestamp: number, format: string) {
const formattedTimestamp = useMemo(() => {
return formatUnixTimestampToDateTime(timestamp, {
strftime_fmt: format,
});
}, [format, timestamp]);
return formattedTimestamp;
}