Skip to content

Scheduling infrastructure for absolutely everyone.

Fix weekStart passThrough + allow all days (#3108)

Alex van Andel5ca914b32e05
diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx
index a522d927712..29c83cb7744 100644
--- a/apps/web/components/booking/pages/AvailabilityPage.tsx
+++ b/apps/web/components/booking/pages/AvailabilityPage.tsx
@@ -664,6 +664,13 @@ const AvailabilityPage = ({ profile, eventType }: Props) => {
)*/}
</div>
<SlotPicker
+ weekStart={
+ typeof profile.weekStart === "string"
+ ? (["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].indexOf(
+ profile.weekStart
+ ) as 0 | 1 | 2 | 3 | 4 | 5 | 6)
+ : profile.weekStart /* Allows providing weekStart as number */
+ }
eventType={eventType}
timezoneDropdown={timezoneDropdown}
timeZone={timeZone}
diff --git a/apps/web/pages/settings/profile.tsx b/apps/web/pages/settings/profile.tsx
index 834c3706532..bbaa83c0d90 100644
--- a/apps/web/pages/settings/profile.tsx
+++ b/apps/web/pages/settings/profile.tsx
@@ -358,6 +358,11 @@ function SettingsView(props: ComponentProps<typeof Settings> & { localeProp: str
options={[
{ value: "Sunday", label: nameOfDay(props.localeProp, 0) },
{ value: "Monday", label: nameOfDay(props.localeProp, 1) },
+ { value: "Tuesday", label: nameOfDay(props.localeProp, 2) },
+ { value: "Wednesday", label: nameOfDay(props.localeProp, 3) },
+ { value: "Thursday", label: nameOfDay(props.localeProp, 4) },
+ { value: "Friday", label: nameOfDay(props.localeProp, 5) },
+ { value: "Saturday", label: nameOfDay(props.localeProp, 6) },
]}
/>
</div>