Friday 17 August 2007 10:37:57 am
Hi, I need to work on timestamp to compare a date attribute with the current date to print out if an object can be considered as new or not. My starting point :
{def $currentimestamp = cond( and(ne($view_parameters.month, ''), ne($view_parameters.day, ''), ne($view_parameters.year, '')), makedate($view_parameters.month, $view_parameters.day, $view_parameters.year), currentdate() )
$objectimestamp = $node.object.data_map.date_marche.data_int}
What I want is to check if the $objectimestamp is older of 3 monthes than the $currentimestamp but I don't know how to work on $currentimestamp to retrieve him a 3 monthes "timestamp value" to make a new $customtimestamp. Yhan it could be :
{if gt($objectimestamp,$customtimestamp)}
<div class="new">
<img src={"images/new.gif"|ezdesign} height="11" width="48" title="New" alt="New" />
</div>
{/if}
Any hint? Regards. Laurent
|