Using Python…
How can I get a list of the days in a specific week?
Something like…
{
'1' : ['01/03/2010','01/04/2010','01/05/2010','01/06/2010','01/07/2010','01/08/2010','01/09/2010'],
'2' : ['01/10/2010','01/11/2010','01/12/2010','01/13/2010','01/14/2010','01/15/2010','01/16/2010']
}
The key of the dictionary in this example would be the week number.
Beware! If you want to define YOUR OWN week numbers, you could use the generator expression provided in your first question which, by the way, got an awesome answer). If you want to follow the ISO convention for week numbers, you need to be careful:
So, for instance, January 1st and 2nd in 2010 were NOT week one of 2010, but week 53 of 2009.
Python offers a module for finding the week number using the ISO calendar:
Example code:
Notice, again, how January 1st 2010 corresponds to week 53 of 2009.
Using the generator provided in the previous answer:
Dict contains the dictionary you request.