-
-
Notifications
You must be signed in to change notification settings - Fork 734
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: add support for broadcast calendar #2597
Conversation
That’s an interesting idea, @Nradar. Thanks for proposing it. I wasn’t aware of such calendars before. |
Thank you for your feedback! The broadcast calendar is what my company uses for scheduling, so I thought it might be helpful to others as well. I hope the pull request meets the project’s needs, and I’m happy to make any changes if needed to get it approved. 😊 |
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.
@Nradar, this looks great! Thanks for your efforts. I’ve updated the function names and other things to align with our conventions.
There are a few improvements that need to be made to the tests. I can address these personally in another pull request.
Broadcast Calendar Support
Overview
This pull request introduces support for the Broadcast Calendar feature in the DayPicker component. The Broadcast Calendar is designed to accommodate specific scheduling needs, particularly in broadcasting and media contexts, where weeks may not align with traditional calendar weeks.
Key Changes
Broadcast Calendar Prop:
broadcastCalendar
to theDayPicker
component, allowing users to enable the Broadcast Calendar functionality.Date Calculations:
getBroadcastStartDate
andgetBroadcastEndDate
ingetBroadcastCalendar
to calculate the start and end dates of the broadcast weeks based on the first day of the month.getMonths
function to utilize these new helper functions whenbroadcastCalendar
is true.UI Integration:
DayPicker
component to conditionally render the calendar based on thebroadcastCalendar
prop, ensuring that the UI reflects the correct week structure.Documentation:
broadcastCalendar
prop, including examples of how to use it in theDayPicker
component.Localization Support:
More information about broadcast calendar, please refer to https://en.wikipedia.org/wiki/Broadcast_calendar