6eDesign / svelte-calendar

A lightweight datepicker with neat animations and a unique UX.
https://6edesign.github.io/svelte-calendar/
MIT License
543 stars 90 forks source link

[feature] prop to set marked days #136

Open mriot opened 3 years ago

mriot commented 3 years ago

The one thing I am currently missing from this awesome calendar is an option, to set marked/highlighted days. Let's say a prop called marked which I can pass an array of dates, that would be given a certain class name.

Maybe there is already a way to accomplish this, and I just can't see it.

rotimi-best commented 3 years ago

Exactly what I need, I just created an issue related to this.

rotimi-best commented 3 years ago

I found a way around it, it really isn't scalable cause any change in the classes can break this code. but for the main time, this is good enough for me

https://github.com/6eDesign/svelte-calendar/issues/137#issuecomment-962516890

6eDesign commented 2 years ago

This is an interesting idea and is likely something I can support in one fashion or another. It would also be good to be able to disable the selection of some dates. Both could probably be supported by some sort of function that is supplied to the calendar as a prop.

rotimi-best commented 2 years ago

@6eDesign disabling functionality is also a good idea, it makes sense that you would want to disable some dates.

Here is a demo of my hacky workaround

https://user-images.githubusercontent.com/31730715/142431537-dd3295db-9777-4b7d-8c01-d68cb1f777e4.mov