svn commit: r424430 - /incubator/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java

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

svn commit: r424430 - /incubator/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java

sichen
Author: sichen
Date: Fri Jul 21 12:35:02 2006
New Revision: 424430

URL: http://svn.apache.org/viewvc?rev=424430&view=rev
Log:
OFBIZ-99: Fixed bug where EntityUtil.filterByDate() uses the wrong boundary condition. Thanks to Peter Goron.

Modified:
    incubator/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java

Modified: incubator/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java?rev=424430&r1=424429&r2=424430&view=diff
==============================================================================
--- incubator/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java (original)
+++ incubator/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java Fri Jul 21 12:35:02 2006
@@ -179,7 +179,7 @@
                 java.sql.Timestamp fromDate = (java.sql.Timestamp) datedValue.dangerousGetNoCheckButFast(fromDateField);
                 java.sql.Timestamp thruDate = (java.sql.Timestamp) datedValue.dangerousGetNoCheckButFast(thruDateField);
 
-                if ((thruDate == null || thruDate.after(moment)) && (fromDate == null || fromDate.before(moment))) {
+                if ((thruDate == null || thruDate.after(moment)) && (fromDate == null || fromDate.before(moment) || fromDate.equals(moment))) {
                     result.add(datedValue);
                 }// else not active at moment
             }
@@ -188,7 +188,7 @@
                 java.sql.Timestamp fromDate = (java.sql.Timestamp) datedValue.dangerousGetNoCheckButFast(fromDateField);
                 java.sql.Timestamp thruDate = (java.sql.Timestamp) datedValue.dangerousGetNoCheckButFast(thruDateField);
 
-                if ((thruDate == null || thruDate.after(moment)) && (fromDate == null || fromDate.before(moment))) {
+                if ((thruDate == null || thruDate.after(moment)) && (fromDate == null || fromDate.before(moment) || fromDate.equals(moment))) {
                     result.add(datedValue);
                 }// else not active at moment
             }
@@ -199,7 +199,7 @@
                 java.sql.Timestamp fromDate = datedValue.getTimestamp(fromDateName);
                 java.sql.Timestamp thruDate = datedValue.getTimestamp(thruDateName);
 
-                if ((thruDate == null || thruDate.after(moment)) && (fromDate == null || fromDate.before(moment))) {
+                if ((thruDate == null || thruDate.after(moment)) && (fromDate == null || fromDate.before(moment) || fromDate.equals(moment))) {
                     result.add(datedValue);
                 }// else not active at moment
             }
@@ -216,7 +216,7 @@
         java.sql.Timestamp fromDate = datedValue.getTimestamp(fromDateName);
         java.sql.Timestamp thruDate = datedValue.getTimestamp(thruDateName);
 
-        if ((thruDate == null || thruDate.after(moment)) && (fromDate == null || fromDate.before(moment))) {
+        if ((thruDate == null || thruDate.after(moment)) && (fromDate == null || fromDate.before(moment) || fromDate.equals(moment))) {
             return true;
         } else {
             // else not active at moment