svn commit: r934543 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r934543 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java

adrianc
Author: adrianc
Date: Thu Apr 15 18:50:04 2010
New Revision: 934543

URL: http://svn.apache.org/viewvc?rev=934543&view=rev
Log:
One more small performance tweak for TimeDuration.java.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java?rev=934543&r1=934542&r2=934543&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java Thu Apr 15 18:50:04 2010
@@ -98,7 +98,7 @@ public class TimeDuration implements Ser
         deltaMillis = computeDeltaMillis(calStart.getTimeInMillis(), targetMillis);
 
         // compute elapsed months
-        long monthMillis = 86400000 * calStart.getMinimum(Calendar.DAY_OF_MONTH);
+        long monthMillis = 86400000 * (calStart.getMaximum(Calendar.DAY_OF_MONTH) / 2);
         units = deltaMillis / monthMillis;
         this.months = factor * advanceCalendar(calStart, calEnd, (int) units, Calendar.MONTH);
         deltaMillis = computeDeltaMillis(calStart.getTimeInMillis(), targetMillis);