Skip to content
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

Merged
merged 1 commit into from
Mar 19, 2025
Merged

Conversation

lialila
Copy link
Contributor

@lialila lialila commented Mar 17, 2025

Copy link

vercel bot commented Mar 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2025 1:46pm

@lialila lialila force-pushed the uc/update-start-and-end branch from bf3eac5 to 81558ac Compare March 17, 2025 11:55
@lialila lialila requested a review from Copilot March 17, 2025 11:55
Copy link

@Copilot Copilot AI left a 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;

Copy link

github-actions bot commented Mar 17, 2025

size-limit report 📦

Path Size
dist/strapi-slices.cjs.production.min.js 1.74 MB (-0.07% 🔽)
dist/strapi-slices.esm.js 555.18 KB (+0.07% 🔺)

ClaraTschamon
ClaraTschamon previously approved these changes Mar 17, 2025
@lialila lialila force-pushed the uc/update-start-and-end branch from fc43768 to 11b0bc7 Compare March 19, 2025 13:45
@lialila lialila merged commit 64ea7e3 into main Mar 19, 2025
10 checks passed
@lialila lialila deleted the uc/update-start-and-end branch March 19, 2025 14:11
Copy link

🎉 This PR is included in version 7.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants