Input date in business days

I need to input a date in a form, but it must be calculated in business days: 8 business days after the current date.
is it possible to calculate it using moment.js?

1 Like

Hello @Yoshi , I did a script to get the current date, I would always need to enter the date of the 5th of the month, but if it occurred on Saturday or Sunday, it would skip to the next working day. I believe I can help you. The only problem that maybe you have to create a table with holidays to be able to help you.


Hi Yoshi,

I don’t believe there is a function in moment.js to add/subtract business days. You would need to do something similar to what Pedro has shown before. Essentially you would add the 8 days then check and see if the date is on a Saturday or Sunday and change the date accordingly. I also found the following link which might help with some options: link

Thanks,
Arran

2 Likes

Hello @Yoshi, We would like to know if you have successfully found the solution for this use case. If so, please mark the answer as a solution, as it helps other users who have the same challenges.

1 Like