bug #2506 Datepicker displays wrong week numbers

The datepicker displays wrong week numbers if the starting-day is 0 (Sunday),
because it uses the first day of the row to determine the weeknumber of the corresponding row.
According to ISO 8601 the week starts on Monday and ends on Sunday.
Consequently the datapicker will display e.g. for the week Sun Aug 17 - Sat Aug 23 the number of the week that ended on Sun Aug 17 and not the week that starts on Mon Aug 18.
Using the date at middle of the row will display the correct week number regardless of whether the week display starts with a Sunday or a Monday.
Instead of using the middle of the row (3), we should really be using the week number of the Monday on that row. How about looping through the first row to find the Monday on that row, and then get it's week number instead?

That way, if somebody sets `starting-day=5` so that it's `T F S S M T W`, it won't get the week number of the Sunday and would get the week number of the Monday on that row. I think that's more expected and closer to the specification.