[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Products/PluginIndexes/dtml/browseIndex.dtml Fix DateIndex date display; unpack stored integers into something meaningful. This fixes Collector #2316.

Martijn Pieters mj at zopatista.com
Fri Apr 27 04:37:15 EDT 2007


Log message for revision 74850:
  Fix DateIndex date display; unpack stored integers into something meaningful. This fixes Collector #2316.

Changed:
  U   Zope/branches/2.9/lib/python/Products/PluginIndexes/dtml/browseIndex.dtml

-=-
Modified: Zope/branches/2.9/lib/python/Products/PluginIndexes/dtml/browseIndex.dtml
===================================================================
--- Zope/branches/2.9/lib/python/Products/PluginIndexes/dtml/browseIndex.dtml	2007-04-27 08:36:52 UTC (rev 74849)
+++ Zope/branches/2.9/lib/python/Products/PluginIndexes/dtml/browseIndex.dtml	2007-04-27 08:37:14 UTC (rev 74850)
@@ -27,7 +27,16 @@
       <tr>
         <td>
           <dtml-if "meta_type in ('DateIndex',)">
-            <dtml-var "DateTime(_['sequence-key'])">
+            <dtml-comment><!--
+              DateIndexes store dates packed into an integer, unpack
+              into year, month, day, hour and minute, no seconds and UTC.
+            --></dtml-comment>
+            <dtml-var "DateTime((_['sequence-key'] / 535680),
+                                (_['sequence-key'] / 44640 ) % 12,
+                                (_['sequence-key'] / 1440  ) % 31,
+                                (_['sequence-key'] / 60    ) % 24,
+                                (_['sequence-key']         ) % 60,
+                                0, 'UTC')">
           <dtml-else>
             &dtml-sequence-key; 
           </dtml-if>



More information about the Zope-Checkins mailing list