On Fri, Jun 07, 2002 at 09:14:25AM +0100, Tony Bowden wrote:
> On Thu, Jun 06, 2002 at 05:08:56PM -0400, Sam Tregar wrote:
> > > Suppose you have a model object for a concert which includes a date.  On
> > > one page, the designers want to dipslay the date in a verbose way with
> > > the month spelled out, but on another they want it abbreviated and fixed
> > > length so that dates line up nicely.  Would you put that formatting in
> > > the controller?
> > In the script:
> > 
> >    $template->param(long_date  => $long_date,
> >                     short_date => $short_date);
> > In the template:
> > 
> >    The long date: <tmpl_var long_date>  <br>
> >    The short date: <tmpl_var short_date>
> 
> Can I vote for "yick" on this?
> 
> A designer should never have to come to a programmer just to change the
> formatting of a date.
> 
> I'm a huge fan of passing Date::Simple objects, which can then take a
> strftime format string:
> 
>   [% date.format("%d %b %y") %]
>   [% date.format("%Y-%m-%d") %]
> 
> Tony
> 

xmlns:date="http://exslt.org/dates-and-times";  wins for me.

date:date-time()
date:date()
date:time()
date:month-name()
... etc

xslt solutions win for me because it its supported (or seems to be)
by many major languages, and applications. 

xslt stylesheets can be processed, reused and shared with my c,perl,
java,javascript, ruby, mozilla, ieexplorer ... kde apps, gnome apps
... etc

Imagine having your templates and data supported and interoperable ...

Aren't we trying to rid the world of proprietary (only works here) things?

Ed  .... (an axkit lover)

Reply via email to