7
I am working on ASP.NET MVC 4, and I intend to know what is the week of a given month.
For example, the user wants to set a frequency of occurrences, and as such says:
- The occurrence will happen every
2
weeks; - The event will take place this week to Monday and Thursday;
When retrieving this data from the user, I have to generate a date list with this data. The result of the list will be something like:
03/02/2014
- corresponds to the Monday of the second week of February;
06/02/2014
- corresponds to the Thursday of the second week of February;
17/02/2014
- corresponds to the Monday of the fourth week of February;
20/02/2014
- corresponds to the Thursday of the fourth week of February;
03/03/2014
- corresponds to the Monday of the first week of March;
06/03/2014
- corresponds to the Thursday of the first week of March;
... So forth
So I want to try to know how to calculate/know the weeks of the month (I think the solution is to know the number of the week in the year), and still the day of the week in the same week.
Which day does your week start? Sunday? Monday?
– Oralista de Sistemas
It starts on a Monday
– CesarMiguel