Skip to content

Conversation

deiondz
Copy link

@deiondz deiondz commented Dec 24, 2024

This PR updates the CalendarHeaderDateIcon component to utilize the date value provided by useCalendarContext instead of using new Date() directly.

Changes Made:

  • Replaced format(new Date(), 'MMM') with format(date, 'MMM').
  • Ensures the component dynamically reflects changes in the calendar context's date value.
  • Enhances reusability and consistency with the rest of the calendar implementation.

This refactor resolves a partially implemented feature by correctly linking the component to the provided context.
Please review and merge to align the CalendarHeaderDateIcon with the updated functionality.

…of new Date(), enabling dynamic date updates.
Copy link

vercel bot commented Dec 24, 2024

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

Name Status Preview Comments Updated (UTC)
calendar ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 24, 2024 10:30am
calendar-shadcn ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 24, 2024 10:30am

@charlietlamb
Copy link
Owner

Thanks for the contribution @deiondz! Like this idea, originally I had the calendar follow the implementation of https://synergy-platform.vercel.app/calendar - the date on the calendar is always todays date. I think the best move is to offer both options - have a prop which is passed into the component and then use this to decide whether we display todays date or the date of whatever date the calendar is set to. What do you think?

@deiondz
Copy link
Author

deiondz commented Dec 28, 2024

Thanks for the contribution @deiondz! Like this idea, originally I had the calendar follow the implementation of https://synergy-platform.vercel.app/calendar - the date on the calendar is always todays date. I think the best move is to offer both options - have a prop which is passed into the component and then use this to decide whether we display todays date or the date of whatever date the calendar is set to. What do you think?

I think that can be done but from UI/UX point of you, I expected the date to change as we navigate the calendar.

We can offer both options but how do we display that in UI?

If it's today's date then I would want the calendar to go back to current date when we press on the date content header.

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

Successfully merging this pull request may close these issues.

2 participants