P
peetersb
Hi,
I want ot make functions like this:
int getFirtDayOfWeek(int weeknumber, int year);
int getLastDayOfWeek(int weeknumber, int year);
Firts I calculate the count of weeks like this:
DateTime lastDay = new DateTime(DateTime.Now.Year, 12, 31);
DayOfWeek dayOfWeek = lastDay.DayOfWeek;
CultureInfo myCI = new CultureInfo("nl-BE");
Calendar myCal = myCI.Calendar;
CalendarWeekRule myCWR =
myCI.DateTimeFormat.CalendarWeekRule;
DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
int weeks = myCal.GetWeekOfYear(lastDay, myCWR,
myFirstDOW);
So for this year there are 53 weeks.
Now I want the firts day of week 2 for example ( = 7)
and the last day of week 2 (= 13)
How can I do that?
I want ot make functions like this:
int getFirtDayOfWeek(int weeknumber, int year);
int getLastDayOfWeek(int weeknumber, int year);
Firts I calculate the count of weeks like this:
DateTime lastDay = new DateTime(DateTime.Now.Year, 12, 31);
DayOfWeek dayOfWeek = lastDay.DayOfWeek;
CultureInfo myCI = new CultureInfo("nl-BE");
Calendar myCal = myCI.Calendar;
CalendarWeekRule myCWR =
myCI.DateTimeFormat.CalendarWeekRule;
DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
int weeks = myCal.GetWeekOfYear(lastDay, myCWR,
myFirstDOW);
So for this year there are 53 weeks.
Now I want the firts day of week 2 for example ( = 7)
and the last day of week 2 (= 13)
How can I do that?