I'm working on ASP.NET MVC 4, and I want to know what the week is for a given month.
For example, the user wants to define a frequency of occurrences, and as such says:
- The occurrence will occur every%% weeks%;
- The occurrence will happen this week on Monday and Thursday;
When obtaining this user data, I have to generate a list of dates with this data. The result of the list will look something like:
2
- corresponds to the Monday of the second week of February;
03/02/2014
- corresponds to the Thursday of the second week of February;
06/02/2014
- corresponds to the Monday of the fourth week of February;
17/02/2014
- corresponds to the Thursday of the fourth week of February;
20/02/2014
- corresponds to the Monday of the first week of March;
03/03/2014
- corresponds to the Thursday of the first week of March;
... Out there
As such I want to try to know how to calculate / know the weeks of the month (I think the solution happens to know the number of the week in the year), and still the day of the week that week.