From 42dd3064fafbdc9882bf6fd2f216fd7548c071f1 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Thu, 14 Dec 2023 15:11:07 -0700 Subject: [PATCH] Lint fixes --- web-new/src/components/ui/calendar.tsx | 20 +++++++++++--------- web-new/src/types/frigateConfig.ts | 14 +++++++------- web-new/src/utils/dateUtil.ts | 4 ++-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/web-new/src/components/ui/calendar.tsx b/web-new/src/components/ui/calendar.tsx index b065f8e0c..a02526753 100644 --- a/web-new/src/components/ui/calendar.tsx +++ b/web-new/src/components/ui/calendar.tsx @@ -1,11 +1,11 @@ -import * as React from "react" -import { ChevronLeft, ChevronRight } from "lucide-react" -import { DayPicker } from "react-day-picker" +import * as React from "react"; +import { ChevronLeft, ChevronRight } from "lucide-react"; +import { DayPicker } from "react-day-picker"; -import { cn } from "@/lib/utils" -import { buttonVariants } from "@/components/ui/button" +import { cn } from "@/lib/utils"; +import { buttonVariants } from "@/components/ui/button"; -export type CalendarProps = React.ComponentProps +export type CalendarProps = React.ComponentProps; function Calendar({ className, @@ -52,13 +52,15 @@ function Calendar({ ...classNames, }} components={{ + // @ts-ignore IconLeft: ({ ...props }) => , + // @ts-ignore IconRight: ({ ...props }) => , }} {...props} /> - ) + ); } -Calendar.displayName = "Calendar" +Calendar.displayName = "Calendar"; -export { Calendar } +export { Calendar }; diff --git a/web-new/src/types/frigateConfig.ts b/web-new/src/types/frigateConfig.ts index 50539759c..8b5aa8ab2 100644 --- a/web-new/src/types/frigateConfig.ts +++ b/web-new/src/types/frigateConfig.ts @@ -1,11 +1,11 @@ export interface UiConfig { - timezone: string; - time_format: "browser" | "12hour" | "24hour"; - date_style: "full" | "long" | "medium" | "short"; - time_style: "full" | "long" | "medium" | "short"; - strftime_fmt: string; - live_mode: string; - use_experimental: boolean; + timezone?: string; + time_format?: 'browser' | '12hour' | '24hour'; + date_style?: 'full' | 'long' | 'medium' | 'short'; + time_style?: 'full' | 'long' | 'medium' | 'short'; + strftime_fmt?: string; + live_mode?: string; + use_experimental?: boolean; } export interface CameraConfig { diff --git a/web-new/src/utils/dateUtil.ts b/web-new/src/utils/dateUtil.ts index 2ea940ec2..464c4a342 100644 --- a/web-new/src/utils/dateUtil.ts +++ b/web-new/src/utils/dateUtil.ts @@ -143,8 +143,8 @@ export const formatUnixTimestampToDateTime = (unixTimestamp: number, config: UiC // fallback if the browser does not support dateStyle/timeStyle in Intl.DateTimeFormat // This works even tough the timezone is undefined, it will use the runtime's default time zone if (!containsTime) { - const dateOptions = { ...formatMap[date_style]?.date, timeZone: options.timeZone, hour12: options.hour12 }; - const timeOptions = { ...formatMap[time_style]?.time, timeZone: options.timeZone, hour12: options.hour12 }; + const dateOptions = { ...formatMap[date_style ?? ""]?.date, timeZone: options.timeZone, hour12: options.hour12 }; + const timeOptions = { ...formatMap[time_style ?? ""]?.time, timeZone: options.timeZone, hour12: options.hour12 }; return `${date.toLocaleDateString(locale, dateOptions)} ${date.toLocaleTimeString(locale, timeOptions)}`; }