-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: update start and end in event-card #155
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
bf3eac5
to
81558ac
Compare
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.
Pull Request Overview
This pull request updates the event-card to use separate date and time fields for start and end times, and introduces a new utility function to convert Strapi time strings.
- Added a new utility (convertStrapiTime) and its tests for converting time strings.
- Updated the Strapi event model to use startDate/startTime and endDate/endTime instead of a single Date property.
- Modified the EventCard component to display the formatted date and time using the new utility.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/utils/convertStrapiTime.ts | New utility to convert time strings into formatted output. |
src/utils/convertStrapiTime.test.ts | Tests validating the correct behavior of the convertStrapiTime util. |
src/models/strapi/StrapiEvent.ts | Updated event model with separate date and time fields. |
src/components/EventCard/EventCard.tsx | Revised component to render the new event date and time formats. |
Comments suppressed due to low confidence (3)
src/utils/convertStrapiTime.ts:7
- Consider adding input validation to ensure the 'date' string contains the expected colon-separated format to avoid potential runtime errors.
let tempTime = date.split(':');
src/components/EventCard/EventCard.tsx:218
- Ensure that the additional spaces in the template literal do not lead to inconsistent formatting in the UI.
{event.startTime && ` | ${convertStrapiTime(event.startTime, formatNumber)} `}
src/models/strapi/StrapiEvent.ts:44
- [nitpick] Consider documenting the distinction between the 'startDate'/'startTime' and 'endDate'/'endTime' fields to improve clarity in the event model.
startDate?: Date;
192202a
to
4dc372d
Compare
size-limit report 📦
|
7205017
to
29cb554
Compare
da67575
to
8c31e8c
Compare
c1092b5
to
bcb20c1
Compare
9cab8c8
to
be20bf9
Compare
22e14ba
to
b670be7
Compare
fc43768
to
11b0bc7
Compare
🎉 This PR is included in version 7.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
How to handle Time return from Strapi: https://forum.strapi.io/t/problems-dealing-with-datetime-content-type/24022/3