From 491cd92a4dd9aa6c317bdb4c9a9f97822ab2cb84 Mon Sep 17 00:00:00 2001 From: Aaron Maier Date: Fri, 9 Feb 2024 17:21:39 +0100 Subject: [PATCH] Use DATE_FORMAT when parsing selected day At least in the 'single' view mode, the date is sent back in the format "YYYY-MM-DD" and not "YYYY-MM-DD HH:mm" and dayjs fails here while parsing the date. --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index d21d5b5..2038af2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -64,7 +64,7 @@ export function isDateBetween( export const getFormatedDate = (date: DateType, format: string) => dayjs(date).format(format); -export const getDate = (date: DateType) => dayjs(date, CALENDAR_FORMAT); +export const getDate = (date: DateType) => dayjs(date, DATE_FORMAT); export const getYearRange = (year: number) => { const endYear = YEAR_PAGE_SIZE * Math.ceil(year / YEAR_PAGE_SIZE);