If someone were to say something happens in the first or last week of some month, how would you define that span?
Background
I'm working on a library that needs to handle this kind of thing in an intuitive way, but my intuition doesn't claim one case or the other.
I can make it select different behavior but still need a good default.
For a concrete example I'll just to pick an random month: July 2008
s m t w r f s
--------------------
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
(Note: I'll assume the week starts with Sunday but the question could be asked re Monday as well)
What span is the first week of the month?
- June 29 - July 5 -- the week that includes the first
- July 6 - 12 -- the first week that is all the way int the month
The second week is just the 7 days following the first right?
What span is the last week of the month?
- July 27 - Aug 2 -- ditto but the last day
- July 20 - 26 -- ditto but the last week
Non wiki comments welcome