[Zope] handling date properties in <dtml-if>

Maik Roeder roeder@berg.net
Sun, 01 Oct 2000 17:41:26 +0200


Hi !

seb wrote:
> 
> Hi,
> 
> > ... I want to display only those jobs
> > for which the current date is on or after the 'date_posted' and on or
> > before 'offer_expires'. I've tried a bunch of things, but haven't hit upon
> > the winning answer. Any takers?
> 
> Try
> 
> <dtml-in "objectValues('Jobs')" sort="date_posted">
>   <dtml-if "offer_expires.isFuture()">
>     <dtml-if "date_posted.isPast()">
>       Job: <dtml-var title> <br>
>     </dtml-if>
>   </dtml-if>
> </dtml-in>

I have added it to he ZSnippets:

http://zdp.zope.org/projects/zsnippet/snippets/time/expiration

Regards,

Maik Röder

-- 
Uzopia - Digging la vida Zopa - http://uzopia.editthispage.com