Is there a concept of working-days in the Nodatime

2019-02-20 06:00发布

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?

标签: nodatime
1条回答
Explosion°爆炸
2楼-- · 2019-02-20 06:39

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.

查看更多
登录 后发表回答