Re: Comparing dates

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Tuesday, May 10, 2011, 9:57:52 AM, Jochen Wiedmann wrote:

> Okay, thank you!

Wait... my memory haven't served well. Comparisons (<, <=, >, >=, ==)
are in fact supported for dates. So you can just write:

  <#if "01.04.2011"?date("dd.MM.yyyy") < "04.04.2011"?date("dd.MM.yyyy")>

Sorry if I caused any extra work...

> On Tue, May 10, 2011 at 2:09 AM, Daniel Dekany <[email protected]> wrote:
>> FreeMarker currently doesn't support date arithmetic. So right now you
>> had write some helper methods (TemplateHashModelEx), and put them into
>> the data-model, or expose them in an #inlcude-d/#import-ed template
>> (where you can do <#assign compareDates =
>> "com.example.MyComparatorMethod"?new()>).
>>
>> --
>> Best regards,
>>  Daniel Dekany
>>
>>
>> Monday, May 9, 2011, 11:29:05 PM, Jochen Wiedmann wrote:
>>
>>> Any idea, how to get the following working? What I'd like to do is to
>>> compare the dates.
>>>
>>>
>>>
>>>     <#if
>>> "01.04.2011"?date("dd.MM.yyyy").asDate.before("04.04.2011"?date("dd.MM.yyyy").asDate)>
>>
>>
>> ------------------------------------------------------------------------------
>> Achieve unprecedented app performance and reliability
>> What every C/C++ and Fortran developer should know.
>> Learn how Intel has extended the reach of its next-generation tools
>> to help boost performance applications - inlcuding clusters.
>> http://p.sf.net/sfu/intel-dev2devmay
>> _______________________________________________
>> FreeMarker-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>>
>
>
>

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.