XModPro

Select Case/Else - For Dates - Not Working

Jeff M. Jeff M. asked Mar 25, 2015
Active Mar 25 · Viewed 2243 times
<p>Trying to get Select/Case/Else working for comparing dates; this isn't working. &nbsp;Else is always being selected.</p><p>I have a listing of items in a template and I want the expired items to have their expired items displayed in red.</p><p>&lt;xmod:select&gt;<br>&lt;case comparetype="Date" operator="&lt;" value='[[ExpirationDate]]' expression="[[DateAdd:0,y,M/dd/yyyy h:mm:ss tt]]"&gt;<br>&lt;span style="color:red;"&gt;&lt;xmod:Format type="Date" value='[[ExpirationDate]]' Pattern="ddd MMM dd yyyy h:mm tt"/&gt; - Expired&lt;/span&gt;<br>&lt;/case&gt;</p><p> &lt;else&gt;<br>&lt;xmod:Format type="Date" value='[[ExpirationDate]]' Pattern="ddd MMM dd yyyy h:mm tt"/&gt;&lt;br/&gt;[[ExpirationDate]]&lt;br/&gt;[[DateAdd:0,y,M/dd/yyyy h:mm:ss tt]]<br>&lt;/else&gt;<br>&lt;/xmod:select&gt;</p><p>Example of what is displayed in the else statement:</p> <p><table><tbody><tr><td>Expiration Date:</td><td>Wed Mar 11 2015 4:30 PM<br>3/11/2015 4:30:00 PM<br>3/25/2015 12:39:29 PM</td></tr></tbody></table></p>

1 Answer

Loading answers...