Fixed a bug in UtilDateTime.java - getWeekEnd() returned the wrong value.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@801023 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian Crum
2009-08-04 23:38:55 +00:00
parent d9657692ef
commit 9dbbcd1082
@@ -851,14 +851,10 @@ public class UtilDateTime {
}
public static Timestamp getWeekEnd(Timestamp stamp, TimeZone timeZone, Locale locale) {
Calendar tempCal = toCalendar(stamp, timeZone, locale);
tempCal.set(tempCal.get(Calendar.YEAR), tempCal.get(Calendar.MONTH), tempCal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
tempCal.add(Calendar.WEEK_OF_MONTH, 1);
tempCal.set(Calendar.DAY_OF_WEEK, tempCal.getFirstDayOfWeek());
tempCal.add(Calendar.SECOND, -1);
Timestamp retStamp = new Timestamp(tempCal.getTimeInMillis());
retStamp.setNanos(999999999);
return retStamp;
Timestamp weekStart = getWeekStart(stamp, timeZone, locale);
Calendar tempCal = toCalendar(weekStart, timeZone, locale);
tempCal.add(Calendar.DAY_OF_MONTH, 6);
return getDayEnd(new Timestamp(tempCal.getTimeInMillis()), timeZone, locale);
}
public static Timestamp getMonthStart(Timestamp stamp, TimeZone timeZone, Locale locale) {