Skip to content

Commit 04e3eaf

Browse files
committed
fix(web): Someday event validation error when creating using w key shortcut
issue was because we were using YEAR_MONTH_FORMAT which is 'YYYY-MM', meaning an incorrect date format was being passed to zod and that was triggering the error. Doing a few smoke tests and no issue after changing to YEAR_MONTH_DAY_FORMAT, hopefully it stays like that
1 parent 90157cf commit 04e3eaf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/web/src/common/utils/draft/someday.draft.util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Dayjs } from "dayjs";
22
import { Dispatch } from "redux";
3-
import { YEAR_MONTH_FORMAT } from "@core/constants/date.constants";
3+
import { YEAR_MONTH_DAY_FORMAT } from "@core/constants/date.constants";
44
import { Categories_Event } from "@core/types/event.types";
55
import { draftSlice } from "@web/ducks/events/slices/draft.slice";
66
import { Activity_DraftEvent } from "@web/ducks/events/slices/draft.slice.types";
@@ -13,8 +13,8 @@ export const createSomedayDraft = async (
1313
activity: Activity_DraftEvent,
1414
dispatch: Dispatch,
1515
) => {
16-
const startDate = startOfView.format(YEAR_MONTH_FORMAT);
17-
const endDate = endOfView.format(YEAR_MONTH_FORMAT);
16+
const startDate = startOfView.format(YEAR_MONTH_DAY_FORMAT);
17+
const endDate = endOfView.format(YEAR_MONTH_DAY_FORMAT);
1818

1919
const event = await assembleDefaultEvent(category, startDate, endDate);
2020

0 commit comments

Comments
 (0)