Changeset 1426
- Timestamp:
- 18/12/09 17:25:12 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tupper/trunk/tupper-site/src/main/java/org/kauriproject/tupper/resource/CalendarUtil.java
r1423 r1426 28 28 public static Calendar getCalendar(int week, int year) { 29 29 Calendar calendar = getCalendar(); 30 calendar.set(Calendar.DAY_OF_YEAR, 1);31 30 calendar.set(Calendar.YEAR, year); 32 31 calendar.set(Calendar.WEEK_OF_YEAR, week); 32 33 // For the first and last week of the year, we have to be careful 34 // that the year-value doesn't shift because the day of the week 35 // falls in the other year. 36 if (week == 1) { 37 calendar.set(Calendar.DAY_OF_YEAR, 1); 38 } else { 39 // we don't check explictly for the last week of the year, 40 // but this covers it 41 calendar.set(Calendar.DAY_OF_WEEK, calendar.getFirstDayOfWeek()); 42 } 33 43 return calendar; 34 44 }
