dtml date comparsion help
Hi, Trying to get more familiar with dtml... How do I do a date comparison with dtml-in? I have: <dtml-in "portal_catalog.searchResults( meta_type='CMF Event' , sort_on='Date' , sort_order='reverse' , Subject='All Utilities' , review_state='published' )" size="10"> Some stuff </dtml-in> I want to insert a dtml statement so that only the CMF events that are on or after today show up. Do I do my date comparison in the first line somehow or with a dtml-if a little later? I am trying to say if Date (date mm/dd/yy) >= ZopeTime (date mm/dd/yy) do something. Problem is that I it seems I need to use the fmt attribute on the date comparison so I am a little comfused about syntax. tried something like: <dtml-if expr="Date fmt='%m/%d/%Y' >= ZopeTime fmt='%m/%d/%Y'"> but I do not have the syntax right.
Kelley, Sean writes:
Trying to get more familiar with dtml...
How do I do a date comparison with dtml-in?
I have: <dtml-in "portal_catalog.searchResults( meta_type='CMF Event' , sort_on='Date' , sort_order='reverse' , Subject='All Utilities' , review_state='published' )" size="10"> Some stuff </dtml-in>
I want to insert a dtml statement so that only the CMF events that are on or after today show up. Please read the section about the ZCatalog in the Zope book. You should look for "range" queries.
You may also look in <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> Dieter
participants (2)
-
Dieter Maurer -
Kelley, Sean