Hi,
i have problems formating a given date with jxtemtplate in cocoon 2.1.7
here is my code :
?xml version=1.0?
page
xmlns:c=http://apache.org/cocoon/templates/jx/1.0;
test
c:set var=now value=${java.util.Calendar.getInstance()}/
variant
c:formatDate value=${now}/
/variant
c:set var=sdf
Hello,
c:set var=now value=${java.util.Calendar.getInstance()}/
try c:set var=now value=${java.util.Calendar.getInstance().getTime()}/
Marc
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Marc Salvetti wrote:
Hello,
c:set var=now value=${java.util.Calendar.getInstance()}/
try c:set var=now
value=${java.util.Calendar.getInstance().getTime()}/
the new version also doesn't work:
?xml version=1.0?
page
xmlns:c=http://apache.org/cocoon/templates/jx/1.0;
test
c:set var=now
You can use the i18n transformer and pass the parameter $now to your
stylesheet like this :
map:transform src=stylesheets/transform.xsl
map:parameter name=now value={date:date} /
/map:transform
then in the xsl :
i18n:date src-pattern=your pattern from cocoon.xconf
... or maybe better,
format your date in the fowscript function that call your jx template,
and make it available from the template with
cocoon.sendPage(the-jx-pipe, {now : formattedDate})
Marc
Frank Taffelt a écrit :
Marc Salvetti wrote:
Hello,
c:set var=now
Hi,
try jx:formatDate value=${java.util.Calendar.getInstance().getTime
()} pattern=dd.MM. /
HTH, Joose
Frank Taffelt kirjoitti 19.8.2005 kello 14:24:
Marc Salvetti wrote:
Hello,
c:set var=now value=${java.util.Calendar.getInstance()}/
try c:set var=now
this was also one of the other ways i tried, but it didn't work. Can
somebody confirm that this construct should work? If yes it's bug !
Joose Vettenranta wrote:
Hi,
try jx:formatDate value=${java.util.Calendar.getInstance().getTime
()} pattern=dd.MM. /
HTH, Joose
Frank Taffelt
Hi,
I have in my softwares date in session which I use formatDate and it
works, so your problem perhaps is to get that Date instance..
how about using ${java.util.Date.getInstance()} ?
HTH, Joose
Frank Taffelt kirjoitti 19.8.2005 kello 15:51:
this was also one of the other ways i tried,