Lint fixes

This commit is contained in:
Nick Mowen 2023-12-14 15:11:07 -07:00
parent d7812c28c6
commit 42dd3064fa
3 changed files with 20 additions and 18 deletions

View File

@ -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<typeof DayPicker>
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
function Calendar({
className,
@ -52,13 +52,15 @@ function Calendar({
...classNames,
}}
components={{
// @ts-ignore
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
// @ts-ignore
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
}}
{...props}
/>
)
);
}
Calendar.displayName = "Calendar"
Calendar.displayName = "Calendar";
export { Calendar }
export { Calendar };

View File

@ -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 {

View File

@ -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)}`;
}