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

Would you please disable holidays on calendar? #21

Open
SomayehAmiri76 opened this issue Dec 10, 2023 · 4 comments
Open

Would you please disable holidays on calendar? #21

SomayehAmiri76 opened this issue Dec 10, 2023 · 4 comments

Comments

@SomayehAmiri76
Copy link

SomayehAmiri76 commented Dec 10, 2023

showing holidays and making them disabled is so much useful. I need that in my project, I should handle it in other ways now but having this feature is really helpful, I would appreciate if you add holidays, or make a property like flag, to customize showing holidays in it.
thanks

@ijavad805
Copy link
Owner

ijavad805 commented Dec 11, 2023

Hello, I'm glad to hear that! To disable specific days, you can use the disabledDate prop. For instance, if you want to disable Fridays, you can achieve this with the following code:

disableDate={(date)=> {
     if(date.day() === 5){ 
          return true; // mean this day should be disabled
     }
     
     return false;
}}

By the way, you can also change the style of specific days with the following code

dayEffects={[
        {
          day: '2022-09-12',
          color: 'red',
          dotColor: 'red',
          title: 'What ever you want',
        },
      ]}

@SomayehAmiri76
Copy link
Author

I got that, thank you.
But in this way, for example, I should have list of holidays of a year and check each day if it is included in holidays to disable them, if the calendar could handle it using a prop like "disableHolidays", it would be better and the code where it's used would be cleaner.

@ijavad805
Copy link
Owner

Well, that's a good idea,
but please consider that we have about 200 countries with different holidays.

@Arcadio-1
Copy link

if lang={'fa'} could use this option: disableHolidays ={true}

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

3 participants