diff --git a/apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-policy-drawer/RolloutAndTiming.tsx b/apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-policy-drawer/RolloutAndTiming.tsx index 61c02e5e1..87f36f7f7 100644 --- a/apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-policy-drawer/RolloutAndTiming.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment-policy-drawer/RolloutAndTiming.tsx @@ -148,10 +148,13 @@ export const RolloutAndTiming: React.FC<{ onChange={(t) => { onChange({ ...value, - startTime: t.toDate( - Intl.DateTimeFormat().resolvedOptions() - .timeZone, - ), + startTime: + t != null + ? t.toDate( + Intl.DateTimeFormat().resolvedOptions() + .timeZone, + ) + : new Date(), }); }} />{" "} @@ -161,10 +164,13 @@ export const RolloutAndTiming: React.FC<{ onChange={(t) => { onChange({ ...value, - endTime: t.toDate( - Intl.DateTimeFormat().resolvedOptions() - .timeZone, - ), + endTime: + t != null + ? t.toDate( + Intl.DateTimeFormat().resolvedOptions() + .timeZone, + ) + : new Date(), }); }} aria-label="End Time" diff --git a/apps/webservice/src/app/[workspaceSlug]/(app)/_components/filter/DateConditionRender.tsx b/apps/webservice/src/app/[workspaceSlug]/(app)/_components/filter/DateConditionRender.tsx index 0bd292974..7a17a8a06 100644 --- a/apps/webservice/src/app/[workspaceSlug]/(app)/_components/filter/DateConditionRender.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/(app)/_components/filter/DateConditionRender.tsx @@ -82,7 +82,7 @@ export const DateConditionRender: React.FC = ({
value != null && setDate(value)} aria-label={type} variant="filter" /> diff --git a/apps/webservice/src/app/[workspaceSlug]/(app)/systems/JobHistoryChart.tsx b/apps/webservice/src/app/[workspaceSlug]/(app)/systems/JobHistoryChart.tsx index b7453564a..f6d5e8b06 100644 --- a/apps/webservice/src/app/[workspaceSlug]/(app)/systems/JobHistoryChart.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/(app)/systems/JobHistoryChart.tsx @@ -272,7 +272,7 @@ export const JobHistoryChart: React.FC<{ animationDuration={animationDuration} fill={color} onClick={(e) => { - const start = new Date(e.date); + const start = new Date((e as any).date); const end = addDays(start, 1); const afterStartCondition: JobCondition = { diff --git a/packages/ui/src/date-time-picker/date-time-picker.tsx b/packages/ui/src/date-time-picker/date-time-picker.tsx index 9cc458e63..5b2e609d3 100644 --- a/packages/ui/src/date-time-picker/date-time-picker.tsx +++ b/packages/ui/src/date-time-picker/date-time-picker.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/unbound-method */ "use client"; import type { DateValue } from "react-aria"; @@ -71,7 +70,7 @@ const DateTimePicker = React.forwardRef< value != null && state.setTimeValue(value)} /> )}