Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a concept of working-days in the Nodatime library?

Tags:

nodatime

Is there a concept of working-days in the Nodatime library?

What I would like to do is to somehow state that there is 5 working-days in a calender week, and then be able to ask something like:

From [any given date] + 10 working-days what is the end date?

or

From [this calender date] to [that calender date] how many working-days are in that interval?

like image 712
Terje Avatar asked Oct 18 '25 07:10

Terje


1 Answers

No, this doesn't exist as you described it. However, you can certainly use Noda Time's LocalDate object and implement your own logic. An O(n) implementation would simply use LocalDate.DayOfWeek and a for loop. I'm sure one could create an O(1) implementation easily as well.

like image 149
Matt Johnson-Pint Avatar answered Oct 21 '25 16:10

Matt Johnson-Pint