mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-04 02:05:21 +03:00
underscore props instead of camelCase
This commit is contained in:
parent
0f86a800c6
commit
f9f8ba7ec6
@ -38,13 +38,13 @@ export const getNowYesterdayInLong = (): number => {
|
|||||||
interface DateTimeStyle {
|
interface DateTimeStyle {
|
||||||
timezone: string;
|
timezone: string;
|
||||||
use12hour: boolean | undefined;
|
use12hour: boolean | undefined;
|
||||||
dateStyle: 'full' | 'long' | 'medium' | 'short';
|
date_style: 'full' | 'long' | 'medium' | 'short';
|
||||||
timeStyle: 'full' | 'long' | 'medium' | 'short';
|
time_style: 'full' | 'long' | 'medium' | 'short';
|
||||||
strftime_fmt: string;
|
strftime_fmt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const formatUnixTimestampToDateTime = (unixTimestamp: number, config: DateTimeStyle): string => {
|
export const formatUnixTimestampToDateTime = (unixTimestamp: number, config: DateTimeStyle): string => {
|
||||||
const { timezone, use12hour, dateStyle, timeStyle, strftime_fmt } = config;
|
const { timezone, use12hour, date_style, time_style, strftime_fmt } = config;
|
||||||
const locale = window.navigator?.language || 'en-US';
|
const locale = window.navigator?.language || 'en-US';
|
||||||
|
|
||||||
if (isNaN(unixTimestamp)) {
|
if (isNaN(unixTimestamp)) {
|
||||||
@ -61,8 +61,8 @@ export const formatUnixTimestampToDateTime = (unixTimestamp: number, config: Dat
|
|||||||
|
|
||||||
// else use Intl.DateTimeFormat
|
// else use Intl.DateTimeFormat
|
||||||
const formatter = new Intl.DateTimeFormat(locale, {
|
const formatter = new Intl.DateTimeFormat(locale, {
|
||||||
dateStyle,
|
dateStyle: date_style,
|
||||||
timeStyle,
|
timeStyle: time_style,
|
||||||
timeZone: timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,
|
timeZone: timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||||
hour12: use12hour !== null ? use12hour : undefined,
|
hour12: use12hour !== null ? use12hour : undefined,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user