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 * as React from "react";
import { ChevronLeft, ChevronRight } from "lucide-react" import { ChevronLeft, ChevronRight } from "lucide-react";
import { DayPicker } from "react-day-picker" import { DayPicker } from "react-day-picker";
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button" import { buttonVariants } from "@/components/ui/button";
export type CalendarProps = React.ComponentProps<typeof DayPicker> export type CalendarProps = React.ComponentProps<typeof DayPicker>;
function Calendar({ function Calendar({
className, className,
@ -52,13 +52,15 @@ function Calendar({
...classNames, ...classNames,
}} }}
components={{ components={{
// @ts-ignore
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />, IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
// @ts-ignore
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />, IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
}} }}
{...props} {...props}
/> />
) );
} }
Calendar.displayName = "Calendar" Calendar.displayName = "Calendar";
export { Calendar } export { Calendar };

View File

@ -1,11 +1,11 @@
export interface UiConfig { export interface UiConfig {
timezone: string; timezone?: string;
time_format: "browser" | "12hour" | "24hour"; time_format?: 'browser' | '12hour' | '24hour';
date_style: "full" | "long" | "medium" | "short"; date_style?: 'full' | 'long' | 'medium' | 'short';
time_style: "full" | "long" | "medium" | "short"; time_style?: 'full' | 'long' | 'medium' | 'short';
strftime_fmt: string; strftime_fmt?: string;
live_mode: string; live_mode?: string;
use_experimental: boolean; use_experimental?: boolean;
} }
export interface CameraConfig { 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 // 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 // This works even tough the timezone is undefined, it will use the runtime's default time zone
if (!containsTime) { if (!containsTime) {
const dateOptions = { ...formatMap[date_style]?.date, 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 }; const timeOptions = { ...formatMap[time_style ?? ""]?.time, timeZone: options.timeZone, hour12: options.hour12 };
return `${date.toLocaleDateString(locale, dateOptions)} ${date.toLocaleTimeString(locale, timeOptions)}`; return `${date.toLocaleDateString(locale, dateOptions)} ${date.toLocaleTimeString(locale, timeOptions)}`;
} }