text: public int getWeekNo(DateTime dt, int weekStartOn){GregorianCalendar cal = new GregorianCalendar();int weekOfYear;if (weekStartOn == 1){weekOfYear = cal.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Sunday);}else{weekOfYear = cal.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday);}return weekOfYear;}