Who really ever used <% if Expires.InPast %> ... <% end_if %>?
I'm struggling for over a year and it does not make any sense to me! See my post on 26 April 2009. (And I'm not the only one, that cannot figure it out.)
I even bought the SilverStripe Book and on page 134 it says how it should work. but, please, wil anybody try it? Do not suppose that it will work, please try it! It does NOT work! The function outputs a 1 if the date is in the past, but it shows all the dates, regardless if it is in the past or not.
Read this code below and the output, and read it carefully: 'Expiringdate has expired 24 days away.' is the output. Can you figure this out? Who will teach me how to use Expires.InPast or is it just FAKE?
As you can tell, I'm desperate!
Code:
-------
<% if Expires.InPast %>
<h3>THE DATE HAS EXPIRED!</h3>
<p><i>Today is $Now.</i></p>
<p>Expiringdate is $Expires.</p>
<p>Expiringdate has expired $Expires.Ago.</p>
<% else %>
<h3>Not yet Expired</h3>
<p>Expiringdate will be $Expires.</p>
<% end_if %>
output:
-------
THE DATE HAS EXPIRED!
Today is 2009-04-25.
Expiringdate is 2009-05-20.
Expiringdate has expired 24 days away.
-------
I'm using SilverStripe-v2.3.1.