Depending on where you live, different rules are used to determine the number of the week and a weekday. You have no chance Show archive.org snapshot whatsoever Show archive.org snapshot to get this right globally unless you make it your life's purpose. However, when you work for clients from Europe or the US, there are two dominantish standards you should know about. Each of these has subtle differences.
1..7
(mind the range difference to
Date#wday
Show archive.org snapshot
).1..53
0..6
(mind the range difference to
Date#cwday
Show archive.org snapshot
)Date
as used in the USA.