-
Notifications
You must be signed in to change notification settings - Fork 67
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
How to get business days #82
Comments
Hi @AntonyDamico, have you tried using moment.localeDate()._holidays? You might need to replace moment with whatever you're importing moment-business-days as. On a sort of related note, I am needing to configure holidays as well and was wondering how you're accounting for holidays in which the date may change from year to year? For example, MLK was on the January 20th this year but January 21st last year. |
@ebui91, I actually figured out and added it as a new method, but thanks anyway. On your question, The backend devs used a holidays API and saved a buch of years in the db, I think This is the API. |
Hello, I'm in the exactly same issue as @AntonyDamico, can you share your solution if you still have it please ? |
It was just the format don't mind me! |
@Nicolas-Menettrier sure, as @ebui91 said I used localeData()._holidays. I just went to the source code ant the end and added these lines moment.fn.getHolidays = function () {
return this.localeData()._holidays
} And then you can just use getHolidays () as a function. |
Oh ok, good then! |
I modified the locale to add holidays but now I need to know how many I added in another part that, is there a way to get them from the moment object? I know I could just use the holidays variable, but I want to use the moment object.
The text was updated successfully, but these errors were encountered: