diff --git a/crabfit-frontend/src/pages/Event/Event.tsx b/crabfit-frontend/src/pages/Event/Event.tsx index a0184e1..cfb415b 100644 --- a/crabfit-frontend/src/pages/Event/Event.tsx +++ b/crabfit-frontend/src/pages/Event/Event.tsx @@ -366,6 +366,22 @@ const Event = (props) => { onChange={event => setTimezone(event.currentTarget.value)} options={timezones} /> + {event?.timezone && event.timezone !== timezone &&
This event was created in the timezone {event.timezone}. { + e.preventDefault(); + setTimezone(event.timezone); + }}>Click here to use it.
} + {(( + Intl.DateTimeFormat().resolvedOptions().timeZone !== timezone + && (event?.timezone && event.timezone !== Intl.DateTimeFormat().resolvedOptions().timeZone) + ) || ( + event?.timezone === undefined + && Intl.DateTimeFormat().resolvedOptions().timeZone !== timezone + )) && ( +Your local timezone is detected to be {Intl.DateTimeFormat().resolvedOptions().timeZone}. { + e.preventDefault(); + setTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone); + }}>Click here to use it.
+ )}