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

风流意气都作罢 提交于 2020-03-15 07:23:05

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!