Author: adrianc
Date: Sat Dec 24 20:00:50 2011
New Revision: 1223007

URL: http://svn.apache.org/viewvc?rev=1223007&view=rev
Log:
Fixed a bug in the getWorkEffortEventsByPeriod service, where the value of the 
start parameter was being changed - causing incorrect results with periods that 
do not start at the beginning of the day.

This change might cause problems with client code that assumes the service 
aligns the start parameter to the start of the day. In those cases, the start 
parameter alignment should be moved to the client code. See the WorkEffort 
component Days.groovy, Week.groovy, or Month.groovy scripts for examples.

Modified:
    
ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java

Modified: 
ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=1223007&r1=1223006&r2=1223007&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
 (original)
+++ 
ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
 Sat Dec 24 20:00:50 2011
@@ -536,7 +536,9 @@ public class WorkEffortServices {
         }
 
         // get a timestamp (date) for the beginning of today and for beginning 
of numDays+1 days from now
-        Timestamp startStamp = UtilDateTime.getDayStart(startDay, timeZone, 
locale);
+        // Commenting this out because it interferes with periods that do not 
start at the beginning of the day
+        // Timestamp startStamp = UtilDateTime.getDayStart(startDay, timeZone, 
locale);
+        Timestamp startStamp = startDay;
         Timestamp endStamp = UtilDateTime.adjustTimestamp(startStamp, 
periodType, 1, timeZone, locale);
         long periodLen = endStamp.getTime() - startStamp.getTime();
         endStamp = UtilDateTime.adjustTimestamp(startStamp, periodType, 
numPeriods, timeZone, locale);


Reply via email to