Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typing to dateUtils.ts #777

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ const Schedule = <T extends {
value={typeof formik.values.scheduleStartDate === "string" ? parseISO(formik.values.scheduleStartDate): formik.values.scheduleStartDate}
onChange={(value) => {
if (formik.values.sourceMode === "SCHEDULE_MULTIPLE") {
changeStartDateMultiple(
value && changeStartDateMultiple(
value,
formik.values,
formik.setFieldValue
Expand Down Expand Up @@ -464,7 +464,7 @@ const Schedule = <T extends {
name="scheduleEndDate"
value={typeof formik.values.scheduleEndDate === "string" ? parseISO(formik.values.scheduleEndDate) : formik.values.scheduleEndDate}
onChange={(value) =>
changeEndDateMultiple(
value && changeEndDateMultiple(
value,
formik.values,
formik.setFieldValue
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/TimeSeriesStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const TimeSeriesStatistics = ({
// format selected time to display as name of timeframe
// @ts-expect-error TS(7006): Parameter 'from' implicitly has an 'any' type.
const formatSelectedTimeframeName = (from, timeMode) => {
return localizedMoment(from, currentLanguage).format(
return localizedMoment(from, currentLanguage ? currentLanguage.dateLocale.code : "en").format(
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
formatStrings[timeMode]
);
Expand Down
Loading
Loading