[Erp5-report] r18054 - /erp5/trunk/products/ERP5Form/FormulatorPatch.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Dec 6 13:42:47 CET 2007


Author: jerome
Date: Thu Dec  6 13:42:46 2007
New Revision: 18054

URL: http://svn.erp5.org?rev=18054&view=rev
Log:
quick and dirty hack to support 2 digit years in datetime fields again.

Modified:
    erp5/trunk/products/ERP5Form/FormulatorPatch.py

Modified: erp5/trunk/products/ERP5Form/FormulatorPatch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/FormulatorPatch.py?rev=18054&r1=18053&r2=18054&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/FormulatorPatch.py (original)
+++ erp5/trunk/products/ERP5Form/FormulatorPatch.py Thu Dec  6 13:42:46 2007
@@ -1163,7 +1163,17 @@
               tmp_day = DateTime(tmp_year, tmp_month, 1, hour, minute)
               result = tmp_day - 1
             else:
-              result = DateTime('%s/%s/%s %s:%s %s' %(int(year), int(month), int(day), hour, minute, timezone))
+              result = DateTime(int(year),
+                                int(month),
+                                int(day),
+                                hour,
+                                minute)
+              year = result.year()
+              result = DateTime('%s/%s/%s %s:%s %s' % (year,
+                                  int(month),
+                                  int(day),
+                                  hour,
+                                  minute, timezone))
          # ugh, a host of string based exceptions (not since Zope 2.7)
         except ('DateTimeError', 'Invalid Date Components', 'TimeError',
                 DateError, TimeError) :




More information about the Erp5-report mailing list