[Zope-Checkins] SVN: Zope/trunk/src/OFS/dtml/properties.dtml - Fixed editing offset-naive 'date' properties in the ZMI.

Yvo Schubbe y.2011 at wcm-solutions.de
Thu Mar 10 06:09:37 EST 2011


Log message for revision 120841:
  - Fixed editing offset-naive 'date' properties in the ZMI.

Changed:
  U   Zope/trunk/src/OFS/dtml/properties.dtml

-=-
Modified: Zope/trunk/src/OFS/dtml/properties.dtml
===================================================================
--- Zope/trunk/src/OFS/dtml/properties.dtml	2011-03-10 11:09:15 UTC (rev 120840)
+++ Zope/trunk/src/OFS/dtml/properties.dtml	2011-03-10 11:09:36 UTC (rev 120841)
@@ -86,10 +86,11 @@
   <input type="text" name="&dtml-id;:&dtml-type;" size="35"
    value="<dtml-if "hasProperty(id)"><dtml-var
     "('%s' % getProperty(id))" html_quote></dtml-if>" />
-  <dtml-elif "type in ('float', 'date')">
+  <dtml-elif "type == 'date' and not _.same_type(getProperty(id), '')
+              and getProperty(id).timezoneNaive()">
   <input type="text" name="&dtml-id;:&dtml-charset_tag;&dtml-type;" size="35"
-   value="<dtml-var "getProperty(id)" html_quote>" />
-  <dtml-elif "type in ['string','ustring']">
+   value="<dtml-var "str(getProperty(id)).rsplit(' ', 1)[0]" html_quote>" />
+  <dtml-elif "type in ['date', 'float', 'string', 'ustring']">
   <input type="text" name="&dtml-id;:&dtml-charset_tag;&dtml-type;" size="35"
    value="<dtml-var "getProperty(id)" html_quote>" />
   <dtml-elif "type=='boolean'">



More information about the Zope-Checkins mailing list