You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Attila Szegedi <sz...@freemail.hu> on 2002/10/21 00:07:33 UTC

Standardized tools for date/number formatting etc., was Re: you-know-what

----- Original Message -----
From: "Attila Szegedi" <sz...@freemail.hu>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Sunday, October 20, 2002 7:28 PM
Subject: Re: The Debate: [was RE: Bozo Filter Available?]


> Incidentally, FM 2.1 now has comparison operators working for dates as
well
> as a locale and time-zone sensitive date formatting...

Now that I wrote that, I realized that you can easily have date comparisons
in Velocity as well using

#if($date1.compareTo($date2) <any-comparison-operator> 0)

or using date.after() or date.before() instead of compareTo(). Of course,
that's again falling back to the Java API, which I consider a real problem
for template code, as stated earlier. So probably a standardized tool should
be instead the way to solve in Velocity-was this, and localized formatting,
and string manipulation problems.

Attila.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Standardized tools for date/number formatting etc., was Re: you-know-what

Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 10/20/02 6:07 PM, "Attila Szegedi" <sz...@freemail.hu> wrote:

> ----- Original Message -----
> From: "Attila Szegedi" <sz...@freemail.hu>
> To: "Velocity Users List" <ve...@jakarta.apache.org>
> Sent: Sunday, October 20, 2002 7:28 PM
> Subject: Re: The Debate: [was RE: Bozo Filter Available?]
> 
> 
>> Incidentally, FM 2.1 now has comparison operators working for dates as
> well
>> as a locale and time-zone sensitive date formatting...
> 
> Now that I wrote that, I realized that you can easily have date comparisons
> in Velocity as well using
> 
> #if($date1.compareTo($date2) <any-comparison-operator> 0)
> 
> or using date.after() or date.before() instead of compareTo(). Of course,
> that's again falling back to the Java API, which I consider a real problem
> for template code, as stated earlier. So probably a standardized tool should
> be instead the way to solve in Velocity-was this, and localized formatting,
> and string manipulation problems.
> 

I am split on the "Java API as a problem" subject :

On one hand, the fact that we can so transparently use public methods on
objects is nice, as we get so much for free.

On the other hand, and I realized this when talking to the Cheetah folks
about making sure that Velocity templates could be used in Cheetah (and vice
versa...), that language dependence is bad.

Of course, re the second point, I don't know of any templating-ish systems
that have tight binding to a language and are free of the influence of that
language.  Cheetah, for example, is very influenced by Python.  Which is
great if you are using Python and Cheetah...

geir

-- 
Geir Magnusson Jr. 
geirm@adeptra.com                                    +1-203-355-2219 (w)
Adeptra Inc.                                         +1-203-247-1713 (m)



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>