问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/45061203/is-there-a-concept-of-working-days-in-the-nodatime-library