feat: button, calendar, datePicker, input, pagination, icons 추가
This commit is contained in:
13
web-app/app/shared/components/calendar/utils.ts
Normal file
13
web-app/app/shared/components/calendar/utils.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { CalendarDate, type DateValue, fromDate, toCalendarDate } from '@internationalized/date';
|
||||
|
||||
const TIMEZONE = 'Asia/Seoul';
|
||||
|
||||
export function dateToCalendarDate(date: Date | null): CalendarDate | null {
|
||||
if (!date) return null;
|
||||
return toCalendarDate(fromDate(date, TIMEZONE));
|
||||
}
|
||||
|
||||
export function calendarDateToDate(value: DateValue | null): Date | null {
|
||||
if (!value) return null;
|
||||
return value.toDate(TIMEZONE);
|
||||
}
|
||||
Reference in New Issue
Block a user