Re: [Templates] Stringifying objects in templates

[prev] [thread] [next] [Date index for 2004/11/10]

From: Derrek Long
Subject: Re: [Templates] Stringifying objects in templates
Date: 00:46 on 10 Nov 2004
Drew Taylor wrote:

>In the template I wanted to take the stringified class_date object
>("2004-10-25 09:00:00") and split on the white space to get the
>individual day and hour components. My first thought was:
>
>  [day, time] = schedule.class_date.split(' ');
>
>But this tried calling the split() method on the Class::Date object
>rather than the stringified version. So then I tried:
>
>  [day, time] = ${date.class_date}.split(' ');
>  
>
If class_date really isa Class::Date object can't you just do this?
[%
  date = schedule.class_date.ymd
  time =  schedule.class_date.hms
  day = schedule.class_date.day
%]

-Derrek

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Stringifying objects in templates
Drew Taylor 14:26 on 25 Oct 2004

RE: [Templates] Stringifying objects in templates
Jason Gottshall 19:28 on 25 Oct 2004

Re: [Templates] Stringifying objects in templates
Derrek Long 00:46 on 10 Nov 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52