You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sébastien Geindre <se...@meteo.fr> on 2007/09/13 17:54:06 UTC

C2.2 jx:template generator changes time !!

A strange things happen ...
In a date form field, i fill 2006-12-14T*12:30*:00.000Z, and i got in 
xml 2006-12-14T*00:30*:00.000Z !!!!

definition :
    <fd:field id="endValidityTime" required="true">
      <fd:label>End Validity Time :</fd:label>
      <fd:datatype base="date">
        <fd:convertor type="formatting">
          <fd:patterns>
            <fd:pattern>yyyy-MM-dd'T'hh:mm:ss.000'Z'</fd:pattern>
          </fd:patterns>
        </fd:convertor>
      </fd:datatype>
    </fd:field>

js :

var form = new Form("definition.xml");
var model = form.getModel();
var data = {   "endValidityTime" : model.endValidityTime};
cocoon.sendPage(pipeline, {"data" : data});

sitemap :
            <map:generate type="jx" src="trace.jx"/>     
            <map:serialize type="xml"/>  

jx file :
<?xml version="1.0" encoding="UTF-8"?>
<XMLdata xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
    <endValidityTime><jx:formatDate value="${data.endValidityTime}" 
pattern="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"/></endValidityTime>
</<XMLdata>

when i fill :
form field   --->  xml
2006-12-14T11:30:00.000Z     --->   
<endValidityTime>2006-12-14T11:30:00.000Z</endValidityTime>   OK
2006-12-14T11:60:00.000Z     --->   
<endValidityTime>2006-12-14T12:00:00.000Z</endValidityTime> strange but OK
2006-12-14T*12:00:00*.000Z     --->   
<endValidityTime>2006-12-14T*00:00:00*.000Z</endValidityTime> NOK !!!
2006-12-14T*12:30:00*.000Z     --->   
<endValidityTime>2006-12-14T*00:30:00*.000Z</endValidityTime> NOK !!!
2006-12-14T13:00:00.000Z     --->   
<endValidityTime>2006-12-14T13:00:00.000Z</endValidityTime> OK

It seems that 12 is weird time for jx generator...

Any idea ??


-- 
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr



Re: C2.2 jx:template generator changes time !!

Posted by Joerg Heinicke <jo...@gmx.de>.
On 14.09.2007 3:34 Uhr, Sébastien Geindre wrote:

> it seems that i can see a elephant on my noise !!!

Just curious and going off-topic: Is this some kind of a figure or 
metaphor? It should be "nose", shouldn't it? I've never seen this though 
I have an idea what it means.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: C2.2 jx:template generator changes time !!

Posted by Sébastien Geindre <se...@meteo.fr>.
Joerg Heinicke a écrit :
>
> On 13.09.2007 11:54 Uhr, Sébastien Geindre wrote:
>
>> <fd:pattern>yyyy-MM-dd'T'hh:mm:ss.000'Z'</fd:pattern>
>
>> <jx:formatDate value="${data.endValidityTime}" 
>> pattern="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"/>
>
>> It seems that 12 is weird time for jx generator...
>
> What I notice in your patterns is the difference between H (hours 
> 0-23) and h (am/pm, 1-12) [1]. So it might actually be you who screwes 
> the dates up :)
Thanks a lot !
it seems that i can see a elephant on my noise !!!
>
> Joerg
>
> [1] 
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


-- 
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: C2.2 jx:template generator changes time !!

Posted by Joerg Heinicke <jo...@gmx.de>.
On 13.09.2007 11:54 Uhr, Sébastien Geindre wrote:

> <fd:pattern>yyyy-MM-dd'T'hh:mm:ss.000'Z'</fd:pattern>

> <jx:formatDate value="${data.endValidityTime}" 
> pattern="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"/>

> It seems that 12 is weird time for jx generator...

What I notice in your patterns is the difference between H (hours 0-23) 
and h (am/pm, 1-12) [1]. So it might actually be you who screwes the 
dates up :)

Joerg

[1] http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org