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: display static periods of time #872

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FDuhen
Copy link

@FDuhen FDuhen commented May 3, 2024

Objective of the PR :
In my use-case, I've got events occurring over a few days.
For those specific events, I want to be able to show a view with a specific design for the start day, a specific design for the end day, and a specific design for the in-between.

Content of the PR :
To achieve what I needed, I re-used the logic you implemented with the "Range Selection".
You can now add the parameter highlightedPeriods, which takes a list of Period objects (which is just holding a start date and an end date).
Those highlightedPeriod will be displayed as follows

Enregistrement.de.l.ecran.2024-05-03.a.14.53.17.mov

I think that the "Range Selection" is more important than displaying those events occurring over a few days : for this reason, during the Range Selection, the design of the calendar is overwritten by the design declared for the Range Selection.

Everything can be customized thanks to the CalendarStyle and the CalendarBuilders parameters.

I didn't modify a lot of existing code, it shouldn't impact any of the current users, and I added some tests.
The tests are mainly here to securise the Period object : I wrote an algorithm which job is to merge the overlapping periods that the user can pass as a parameter to the Calendar, easing the display process.

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.

None yet

1 participant