Re: Formatting a date

Marc Palmer <[email protected]> Wed, 29 Mar 2006 08:40:09 +0100
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
On 29 Mar 2006, at 00:41, Keats Kirsch wrote:

> Tim Pizey wrote:
>
>> I have every confidence that these plugable tools will not slow me  
>> or webmacro down if I don't use them,
> Exactly.
>
>> but I cannot understand why anyone would use them.
> Personally, I think this fits well with the separation of  
> concerns.  A template designer should be able to choose and modify  
> the display format of a date without going back to the Java coder.

Yes, plus changes to the display requirements that do not affect the  
model in a material way are possible when you include a raw date - i.e.

#if ($date.Time < $someReferenceDate.Time) #set $color = "red" #end

I know what you are saying Tim - and to tackle this in the past I  
spent a lot of time producing a system that would mutate objects in  
the model to a localized string form, and the code always put both  
sets of data into the context, so that the template had everything  
ready for display (according to application settings also), as well  
as the raw data.

It's a PITA but it gives great flexibility.

Formatting values within templates is often wordy and messy. Much  
nicer to have available a pre-formatted version if possible, as well  
as the raw :)

Cheers



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642