Closed chaooo closed 5 years ago
Hey @chaooo thanks for this clean contribution.
Not sure I understand the optionalDates
. Maybe you mean something like possibleDates
?
And what happens when a user also has defined a beforeShowDay
callback?
I leave it up to our new contributor @monovertex to decide whether we should merge this...
Hi, I'm AFK this week so I can't comment on the code changes. However, I'd refrain from merging new PRs until we handle the other issues with repository organization and lack of unit tests. I'll get started with this ASAP so it shouldn't be long.
Thank you for your reply, the optional date means that the date to choose is given by the user in advance. Since I have a usage scenario where the usable date of a product is an array returned by the backend interface, the selectable date must be within the date returned by the backend interface. So I added the option for the optionalDates
.
I didn't think about the consequences when a user also has defined a beforeShowDay
callback, so this is a bit of a lack of consideration, I hope to consider extending this feature in the future.
Sorry for the long delay.
Since we already have the beforeShowDay
, which can be easily used to achieve this optionalDates
/possibleDates
functionality, I don't think we should include extra code with the same result. Here's a jsfiddle showing how beforeShowDay
can be leveraged. This approach has the advantage that optionalDates
can be dynamic. With the proposed changes in the PR you'd have to re-initialize the datepicker or mutate the option array directly.
I'm closing this PR. If you want to continue the discussion and want to present arguments for implementing the specific optionalDates
parameter, please reply in this thread.