svelte-calendar icon indicating copy to clipboard operation
svelte-calendar copied to clipboard

[feature] prop to set marked days

Open mriot opened this issue 4 years ago • 4 comments

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.

mriot avatar Oct 27 '21 23:10 mriot

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

rotimi-best avatar Nov 02 '21 08:11 rotimi-best

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

rotimi-best avatar Nov 06 '21 22:11 rotimi-best

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.

6eDesign avatar Nov 18 '21 07:11 6eDesign

@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

rotimi-best avatar Nov 18 '21 14:11 rotimi-best