Re: How to compare a date?
| Newsgroups | gmane.comp.cms.jahia.template |
|---|---|
| Message-ID | <OF78B88ED9.6874677A-ONC12570AB.00506325-C12570AB.0050632A@generic.se> |
YES IT WORKS! <bean:define id="myDate" name="myContainer" property="fieldObject(myData)"/> .. <bean:write name="myDate" /> I get the date&time as milli seconds and I will go on and write some selection statements. Regards /Lars Hagrot -----Philippe Vollenweider <[email protected]> wrote: ----- To: <[email protected]> From: Philippe Vollenweider <[email protected]> Date: 10/28/2005 04:01PM Subject: Re: How to compare a date? Hello, If you use scriptlet, you can use the getFieldOject methode JahiaContainer myContainer = (JahiaContainer) entriesEnum.nextElement(); long myDateLong = -1; try { myDateLong = Long.parseLong((String)myContainer.getFieldObject("myDate")); } catch (NumberFormatException nfe) { } Did you try to do seomething similar with taglib (never try)? <bean:define id="myDate" name="myContainer" property="fieldObject(myData)"/> Philippe. At 28.10.2005 15:48, you wrote: I have a container with a startDate and an endDate field. I want to show the container if curent date is in between those dates. How can I compare with current date? (System.currentTimeMillis()) I can find some java code doing by using java code (scriplet) (box_news.inc). But how can we do this by using taglibs (jahia,jstl,struts)? ... <content:dateField ..../> ... <c:if test="${ ????? }"> // Show container fields... </c:if> ... Regards /Lars Hagrot -------=[ pvollenweider at jahia dot com ]=--------- Jahia : A collaborative source CMS and Portal Server www.jahia.org Community and product web site www.jahia.com Commercial services company