Skip to content

Commit 892166b

Browse files
authored
Skip the first day in the CFP availability form (#4210)
1 parent a093b45 commit 892166b

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

frontend/src/components/cfp-form/availability-section.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Spacer,
66
Text,
77
} from "@python-italia/pycon-styleguide";
8-
import { eachDayOfInterval, format, parseISO } from "date-fns";
8+
import { addDays, eachDayOfInterval, format, parseISO } from "date-fns";
99
import { Fragment } from "react";
1010
import { FormattedMessage } from "react-intl";
1111
import { useCurrentLanguage } from "~/locale/context";
@@ -16,21 +16,19 @@ const RANGES = ["am", "pm"];
1616

1717
type Props = {
1818
conferenceData: CfpFormQuery;
19-
selectedDuration: any;
2019
speakerAvailabilities: any;
2120
onChangeAvailability: any;
2221
};
2322
export const AvailabilitySection = ({
2423
conferenceData,
25-
selectedDuration,
2624
speakerAvailabilities,
2725
onChangeAvailability,
2826
}: Props) => {
2927
const language = useCurrentLanguage();
3028
const {
3129
conference: { start, end },
3230
} = conferenceData;
33-
const parsedStart = parseISO(start);
31+
const parsedStart = addDays(parseISO(start), 1);
3432
const parsedEnd = parseISO(end);
3533
const daysBetween = eachDayOfInterval({ start: parsedStart, end: parsedEnd });
3634
const dateFormatter = new Intl.DateTimeFormat(language, {

frontend/src/components/cfp-form/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,6 @@ export const CfpForm = ({
336336
<AvailabilitySection
337337
onChangeAvailability={onChangeAvailability}
338338
speakerAvailabilities={formState.values.speakerAvailabilities}
339-
selectedDuration={allowedDurations.find(
340-
(duration) => duration.id === formState.values.length,
341-
)}
342339
conferenceData={conferenceData}
343340
/>
344341

0 commit comments

Comments
 (0)