mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
9801534f11
* Get cameras filter working * Implement label and review filters * Fix * Add time selection * Cleanup * Cleanup * cleanup * remove commented code * Fix
13 lines
369 B
TypeScript
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;
|
|
}
|