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

recurrence of datesDisabled #127

Closed
mestrini opened this issue Nov 24, 2022 · 7 comments
Closed

recurrence of datesDisabled #127

mestrini opened this issue Nov 24, 2022 · 7 comments

Comments

@mestrini
Copy link

From my understanding, if one doesn't append the year to a date, then only the current year's is disabled, but if the year is appended then same date of different years doesn't get disabled.

Is recurrence of disabled dates possible? If not, is it not in the spirit of the plugin to implement this possibility?

Thank you for this nice plugin.

@mymth
Copy link
Owner

mymth commented Nov 27, 2022

No, it's not possible because the option only accepts an array of fixed dates. But I think it needs to be improved.

For immediate solution, does setting some date in the past 12 months to minDate work?

@mestrini
Copy link
Author

I can't set 12 months for minDate as I have it dynamically set to two weeks in the past, but since minDate and maxDate interval is short, only 1st of january has this issue; in this case I simply set the full date for this day via server code.

Still, I hope you get to implement it, maybe as an option like recurrentDatesDisabled or simply by default. I'll keep an eye on it :)

Thanks

@mymth
Copy link
Owner

mymth commented Dec 4, 2022

Hmm? Doesn't "two weeks in the past" meet "some date in the past 12 months"?
There's no need to set dates outside the min/maxDate range to disabledDates because those dates are rejected by the min/max range check before being checked against disabledDates. In other words, you can use disabledDates only to disable some date(s) inside the min/maxDate range.

Anyway, I'll reopen this for my tracking purpose.

I don't think it's a good to good idea to add an option that only works for a very specific issue, by the way.

@mymth mymth reopened this Dec 4, 2022
@mestrini
Copy link
Author

mestrini commented Dec 4, 2022

I don't think it's a good to add an option that only works for a very specific issue, by the way.

I'd think that fixed holidays isn't a specific thing.
In my case, the calendar is used in a reservation type site, where not all dates are allowed, not just weekends.

There's no need to set dates outside the min/maxDate range to disabledDates because those dates are rejected by the min/max range check before being checked against disabledDates.

Well, I don't think it's working that way.
In my case min/maxDates are dynamic and fixed holidays (same day every year) are set as disabled dates. So if I set some january dates as disabled without the year and maxDate is set for a couple of months in the future and run the app today, the plugin assumes those disabled dates are for 2022 and january 2023 dates won't get disabled. It would get worse if the min/maxDate interval was greater and that would require the developer to make calculations to append next year's year to the date depending on when the site was accessed.

Maybe if not setting a year for the disabled dates, the plugin could accept is as recurrent? Just a thought.

Tx

@mymth
Copy link
Owner

mymth commented Dec 5, 2022

I'd think that fixed holidays isn't a specific thing.

I think you never said in your previous posts that your problem is with fixed holidays. Anyway, it doesn't matter.
I'm not saying your case is a specific thing. What I'm trying to say is, adding an option that solves a very single issue is actually no different from patching a program. Imagine how many options we will need If we keep solving issues in this way. It's a path to make spaghetti code, not improvement. We should seek for a solution that can also work for other related issues instead of patchy solution.

Well, I don't think it's working that way.

Really? Are you able to enter/select 1st of January of any year here?
https://codepen.io/mymth/pen/OJEaeZW

@mestrini
Copy link
Author

mestrini commented Dec 5, 2022

I really don't want to engage in an argument and was never my intention to imply that the plugin's not "working as it should" or that I want a solution for my case. I just thought it was a feature that made sense, even more since I'd seen it implemented in another calendar plugin.

Really? Are you able to enter/select 1st of January of any year here?

When I said I didn't think it was working that way I was talking about plugin's default beahviour.
And thanks for the code you linked but that's what I already had implemented via server code.

Cheers

@mymth
Copy link
Owner

mymth commented Dec 11, 2022

Sorry, I was emotional, feeling tired of people keep asking for adding patch-like options. I apologize.

For the latter part, It was rather confusion than irritation that made me not write in detail. (sorry about that, too)
As your comment made me think you had or were having a problem, but I couldn't imagine what it actually was, I just wanted to confirm if you still see the problem even if the code is written in that way.
(I wonder if anyone can think of "'it' != my explanation" in this context.)

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

No branches or pull requests

2 participants