svn commit: r700579 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/DateRange.java

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

svn commit: r700579 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/DateRange.java

adrianc
Author: adrianc
Date: Tue Sep 30 14:09:28 2008
New Revision: 700579

URL: http://svn.apache.org/viewvc?rev=700579&view=rev
Log:
Fixed the DateRange class so it will work properly when java.sql.Timestamp is used in its constructor. Also cleaned up the toString method.

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

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/DateRange.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/DateRange.java?rev=700579&r1=700578&r2=700579&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/DateRange.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/DateRange.java Tue Sep 30 14:09:28 2008
@@ -36,10 +36,10 @@
 
     public DateRange(Date start, Date end) {
         if (start != null) {
-            this.start = start;
+            this.start = new Date(start.getTime());
         }
         if (end != null) {
-            this.end = end;
+            this.end = new Date(end.getTime());
         }
     }
 
@@ -56,7 +56,7 @@
     }
 
     public String toString() {
-        return super.toString() + ", start = " + this.start + ", end = " + this.end;
+        return this.start + " - " + this.end;
     }
 
     public Date start() {