Re: Check against current date (day)
| Newsgroups | gmane.comp.cms.xaraya.user |
|---|---|
| Organization | Xaraya |
| Message-ID | <[email protected]> |
Naphta wrote:
> I'm using the top items block to display some article titles.
>
> In the corresponding pubtype I use the 'notes' field to let users add a
> date stamp via the dd calendar property.
>
> Now I'm running into problems since in the top items block I want to
> show only articles where the date provided via the calendar property
> 'notes' is equal to the current *day*.
>
> I know that the following snippet won't work (because of the unix time
> stamps including seconds) - not sure if this is possible at all, but I
> really would appreciate any help formating the date.
>
> <xar:if condition="!empty($items)">
> <ul>
> <xar:foreach in="$items" value="$item">
> <xar:set name="time">time</xar:set>
> <xar:set
> name="articleCall">xarModAPIFunc('articles','user','get',array('aid' =>
> $item['aid']))</xar:set>
> <xar:if condition="$articleCall['notes'] eq $time">
> <li>
> <a href="#$item['link']#">#$item['title']#</a>
> </li>
> </xar:if>
> </xar:foreach>
> </ul>
> </xar:if>
>
>
> Karsten
You could try using the php date() function to turn the timestamps into
a string like 2006-10-05 and then compare.
Marc