I am looking for a library doing set operations on time periods with support of weekdays and time of day. I have started to roll my own, but it seems like a error-prone job so I would like a tested solution for this. I don't mind spending money.
If I have a set of two time periods (this can be several)
Setup:
// [period 1]:
TimeSet.Add(1 January 2008-31 January 2008 every Tuesday 14:00-15:00)
// [period 2]
TimeSet.AddWithOr(1 January 2008-15 January 2008 every Tuesday 13:00-14:00)
Results:
TimeSet.ContainsTime(2 January 2008 13:45) = False
TimeSet.ContainsTime(2 January 2008 14:15) = True // [period 1]
TimeSet.ContainsTime(2 January 2008 13:15) = True // [period 2]
I also need range checking functions:
// Only Tuesday 13-15 is in range:
TimeSet.ContainsTime(24 December 2007 13:45,1 January 2008 13:00) = False
TimeSet.ContainsTime(24 December 2007 13:45,2 January 2008 12:59) = False
TimeSet.ContainsTime(24 December 2007 13:45,2 January 2008 13:00) = True
Other more advanced set functions is a plus.
I tried googling for it, but was unable to find anything.