Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(scheduling): display reschedule times in user's timezone (#8275)

Jacob Beckerman6b9f2873c02e
diff --git a/apps/web/src/features/scheduling/components/reschedule-form.tsx b/apps/web/src/features/scheduling/components/reschedule-form.tsx
index 1e24fd6aa7..602184e9bc 100644
--- a/apps/web/src/features/scheduling/components/reschedule-form.tsx
+++ b/apps/web/src/features/scheduling/components/reschedule-form.tsx
@@ -1,14 +1,16 @@
import { fireAndForget } from '@core/util/fireAndForget';
import { Button, DatePicker } from '@ui';
import { createSignal, Show } from 'solid-js';
-import { Field, SelectInput } from './fields';
+import { Field, SelectInput, TimeZoneInput } from './fields';
export function RescheduleForm(props: {
- timeZone: string;
load: (date: string) => Promise<{ startsAt: string; endsAt: string }[]>;
submit: (startsAt: string) => Promise<void>;
onCancel: () => void;
}) {
+ const [zone, setZone] = createSignal(
+ Intl.DateTimeFormat().resolvedOptions().timeZone
+ );
const [date, setDate] = createSignal('');
const [slots, setSlots] = createSignal<
{ startsAt: string; endsAt: string }[]
@@ -62,10 +64,19 @@ export function RescheduleForm(props: {
onSubmit={(e) => fireAndForget(save(e), 'scheduling')}
>
<h2 class="font-semibold">Choose a new time</h2>
- <Field
- label="Date"
- hint={`Dates and times in ${props.timeZone.replaceAll('_', ' ')}`}
- >
+ <Field label="Your time zone">
+ <TimeZoneInput
+ value={zone()}
+ disabled={saving()}
+ onChange={(value) => {
+ setZone(value);
+ setDate('');
+ setSlots([]);
+ setSelected('');
+ }}
+ />
+ </Field>
+ <Field label="Date">
<DatePicker
aria-label="Date"
disabled={saving()}
@@ -101,7 +112,7 @@ export function RescheduleForm(props: {
options={slots().map((s) => ({
value: s.startsAt,
label: new Date(s.startsAt).toLocaleTimeString([], {
- timeZone: props.timeZone,
+ timeZone: zone(),
hour: 'numeric',
minute: '2-digit',
}),
diff --git a/apps/web/src/features/scheduling/views/booking-receipt-view.tsx b/apps/web/src/features/scheduling/views/booking-receipt-view.tsx
index 1f1ae02569..948f8ffc4f 100644
--- a/apps/web/src/features/scheduling/views/booking-receipt-view.tsx
+++ b/apps/web/src/features/scheduling/views/booking-receipt-view.tsx
@@ -167,7 +167,6 @@ export function BookingReceiptView(props: {
}
>
<RescheduleForm
- timeZone={r().scheduleTimeZone}
load={props.loadSlots}
submit={async (start) => {
setError('');