Search
Other Articles Anywhere questions
Forum

IF using a Custom Field of type Date to compare

Marc's Avatar Marc
Hi there!

The following code works perfectly (note: [date] is a Custom Field):
<div class="calendrier">
<p>{articles category="echos-saison-en-cours" ordering="date asc"}</p>
{if date="&gt;now()"}test{/if}<br />
<h2>[link][title][/link]</h2>
<p><span class="uk-badge">[tags]</span> <span uk-icon="calendar"></span> [date format="l d F Y"] <span uk-icon="clock"></span> [heure]<br />[introtext]</p>
<hr />
<p>{/articles}</p>
</div>

Except the following which does not trigger (no matter if I type < or > in the editor, the output remains empty) :
{if date="&gt;now()"}test{/if}

Have I missed something ? (for the rest, ordering by that CF date or displaying that CF date works fine)

Actually, I had taken that example from docs3.regularlabs.com/articlesanywhere/p...alues-relative-dates

But I think that it should be something like
{if date&gt;"now()"}test{/if}
Peter van Westen's Avatar Peter van Westen ADMIN
The if tags are not the same as filters. So the syntax is different.

Yes, you should us:
{if date>"now()"}test{/if}
Please post a rating at the Joomla! Extensions Directory
Marc's Avatar Marc
Okidoki, txs. I had not thought that there was a difference between IF and FILTERS. Good to know.
I learn every day 😉
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription