-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
💄 CMS UI | Updating the Events Component Editor #2288
Conversation
…to give offsets some context
… in the offset options list, and also the use of a the time picker for the CMS window
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Closes #2173. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per our conversation, we need to pick a city, not a timezone. Timezones can change. (daylight savigns)
e.g.
in June, Bob books NDC London for Jan 15th 9am, and sets timezone to Londons current time zone (+1:00 GMT)
London changes from +1:00 GMT to +0:00 GMT on last day of Oct
The event will change from 9am to 8am
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me.
As per our conversation, there are already PBIs in the backlog to improve this so lets merge it as-is
* adding in react-datetime * adding in the hardcoded list of IANA timezone to city name mappings, to give offsets some context * updating the events component by injecting and determining the cities in the offset options list, and also the use of a the time picker for the CMS window * auto-linting stuff and fields added from experimentation (no visual changes * linting error fix * offset hour linting issue – truncation option not recognised * trying new ts ignore locations... * realised I didn't even need the format and can just use trunc * updating the UI message * updating comments and labels * updating pnpm lock * fixes
The two big things here were adding a time picker instead of a number box, and associating major cities to offset values for context (via the moment timezone library).
🤖🤖🤖
This pull request includes significant updates to the
Events
component to improve timezone handling and date formatting, as well as some changes to the JSON data and package dependencies.Updates to
Events
Component:components/blocks/Events.template.tsx
:moment-timezone
for better accuracy and addedDatetime
for date-time input. Updated date and time formatting functions. [1] [2] [3] [4] [5]moment-timezone
.components/blocks/Events.tsx
:startDateUTC
. [1] [2]JSON Data Updates:
components/blocks/EventsTimezones.json
: Added a list of major cities and their respective timezones.content/blocksPages/home.json
: UpdatedstartTime
fields to use ISO 8601 date strings instead of numeric values. [1] [2] [3]Dependency Updates:
package.json
: Addedmoment-timezone
andreact-datetime
to dependencies. [1] [2]Code Cleanup:
pages/[slug].tsx
: Reorganized import statements for better readability. (pages/[slug].tsxL1-R5)🤖🤖🤖
All New Content Submissions: (To be confirmed by reviewer)