Re: Check against current date (day)
Naphta <[email protected]>
| Newsgroups | gmane.comp.cms.xaraya.user |
|---|---|
| Message-ID | <[email protected]> |
> You could try using the php date() function to turn the timestamps into
> a string like 2006-10-05 and then compare.
That's what I did, and it seems to work quite well, now:
<xar:comment> Nur Veranstaltungen von heute </xar:comment>
<xar:if condition="!empty($items)">
<dt>Heute</dt>
<xar:foreach in="$items" value="$item">
<xar:set name="today">date("Ymd")</xar:set>
<xar:set
name="articleCall">xarModAPIFunc('articles','user','get',array('aid' =>
$item['aid']))</xar:set>
<xar:set
name="eventdate">xarLocaleFormatDate('%Y%m%d',$articleCall['notes'])</xar:set>
<xar:if condition="$eventdate eq $today">
<dd>
<a href="#$item['link']#">#$item['title']#</a>
</dd>
</xar:if>
</xar:foreach>
</xar:if>
Karsten