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

Ability to customize date rendering #54

Open
Olivierko opened this issue Jun 18, 2024 · 3 comments
Open

Ability to customize date rendering #54

Olivierko opened this issue Jun 18, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Olivierko
Copy link

Some calendars offer the possibility to customize the rendering of of a single date by adding additional meta data such as price, availability etc.

Is this something that is planned to be implemented into cally?

image

@WickyNilliams
Copy link
Owner

Thanks for creating the issue. As you say it's fairly common for booking calendars. It is something I'd like to add eventually. But I think it's one of the trickier features to get right, so I've been putting it off.

Will leave this open to track the feature

@WickyNilliams WickyNilliams added the enhancement New feature or request label Jul 1, 2024
@mashaal
Copy link

mashaal commented Aug 29, 2024

A modifier similar to isDateDisallowed could be helpful for this too?

isDateModified = (date) => {
  if (soldOut(date)) return "sold-out"
  if (sellingFast(date)) return "selling-fast"
}

The function could include any custom business logic required, and whatever is returned could be added to the date as a class or data-attribute?

@WickyNilliams
Copy link
Owner

@mashaal I don't think a data attribute is a good idea, because you can't style it from the outside. It's essentially inaccessible without reaching into the shadow dom, which is similar to modifying private state - inadvisable.

Maybe it could return CSS parts, then it can be easily styled. That is at pretty easy to implement and opens up arbitrary styles per date

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

No branches or pull requests

3 participants