tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cordenier Christophe <Christophe.Corden...@atosorigin.com>
Subject RE: [jira] Created: (TAP5-841) DateField selects wrong date if client is in a different timezone than the server
Date Wed, 23 Dec 2009 17:35:43 GMT
Hi,

I am currently working on this issue, we have encountered this problem with 5.1.0.5 too.

I suggest this implementation :

for Tapestry datefield.js : pass the client time zone when sending the Ajax Request

new Ajax.Request(url,
        {
            method: 'get',
            parameters: {
                input: input,
                timeZone: new Date().getTimezoneOffset()
            },
            onSuccess: successHandler,
            onFailure: Tapestry.ajaxFailureHandler
        });

For the Tapestry DateField component, modify the timeZone of the current DateFormat object
:

                TimeZone tz = Calendar.getInstance().getTimeZone();
                tz.setRawOffset(Integer.parseInt(request.getParameter("timeZone")) * -1 *
60000);
                format.setTimeZone(tz);

It seems to work, my only fear is about synchronization on DateFormat. Because DateFormat
is not synchronized and the developer can set its own DateFormat that can be singleton (a
mistake that can happen), we may encounter TimeZone conflicts. But by using the defaultFormat
provided by Tapestry, because each component instance has its own 'DateFormat' instance, everything
should be ok.

Regards,
Christophe.


-----Message d'origine-----
De : ross.efi [mailto:ross.efi@att.net]
Envoyé : mercredi 23 décembre 2009 10:08
À : dev@tapestry.apache.org
Objet : Re: [jira] Created: (TAP5-841) DateField selects wrong date if client is in a different
timezone than the server


Does someone have an already-patched version of the jar available?
--
View this message in context: http://old.nabble.com/-jira--Created%3A-%28TAP5-841%29-DateField-selects-wrong-date-if-client-is-in-a-different-timezone-than-the-server-tp25355476p26901830.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org




Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de
ses destinataires. Il peut également être protégé par le secret professionnel. Si vous
recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire.
L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe
Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs
efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur
ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée
pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee;
it may also be privileged. If you receive this e-mail in error, please notify the sender immediately
and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group
liability cannot be triggered for the message content. Although the sender endeavours to maintain
a computer virus-free network, the sender does not warrant that this transmission is virus-free
and will not be liable for any damages resulting from any virus transmitted.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message