[Commits] (twl) Fix [Bug 2245]: TestSimpleQueries.py fails with date range error in December

commits at osafoundation.org commits at osafoundation.org
Wed Dec 1 10:19:05 PST 2004


Commit by: twl
Modified files:
chandler/repository/query/tests/TestSimpleQueries.py 1.16 1.17

Log message:
Fix [Bug 2245]: TestSimpleQueries.py fails with date range error in December
The end date was not wrapping around to January of the following year


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/repository/query/tests/TestSimpleQueries.py.diff?r1=text&tr1=1.16&r2=text&tr2=1.17

Index: chandler/repository/query/tests/TestSimpleQueries.py
diff -u chandler/repository/query/tests/TestSimpleQueries.py:1.16 chandler/repository/query/tests/TestSimpleQueries.py:1.17
--- chandler/repository/query/tests/TestSimpleQueries.py:1.16	Mon Oct 18 13:05:08 2004
+++ chandler/repository/query/tests/TestSimpleQueries.py	Wed Dec  1 10:19:03 2004
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.16 $"
-__date__      = "$Date: 2004/10/18 20:05:08 $"
+__revision__  = "$Revision: 1.17 $"
+__date__      = "$Date: 2004/12/01 18:19:03 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -182,7 +182,10 @@
         startDateString = "%d-%d-%d" % (year,month,1)
         startDate = mx.DateTime.ISO.ParseDate(startDateString)
         startDateString = startDate.date
-        endDateString = "%d-%d-%d" % (year,month+1,1)
+        if month == 12:
+            month1 = 1
+            year1 = year+1
+        endDateString = "%d-%d-%d" % (year1,month1,1)
         endDate = mx.DateTime.ISO.ParseDate(endDateString) -1
         endDateString = endDate.date
         



More information about the Commits mailing list