You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "ross.efi" <ro...@att.net> on 2009/12/23 14:07:35 UTC

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


RE: [jira] Created: (TAP5-841) DateField selects wrong date if client is in a different timezone than the server

Posted by "ross.efi" <ro...@att.net>.
All this info is well and good, but I have no experience building Tapestry
from the source, nor any Maven experience.  I was hoping to get a patched
version of the tapestry-core jar, if possible.

Also, I noticed that ver. 5.1.0.6 is being worked on.  Unfortunately, it
doesn't look like this bug will make it into that release.  I guess there
aren't many Tapestry-based systems that have users in > 1 time zone.

Ross
-- 
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-tp25355476p26945447.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


RE: [jira] Created: (TAP5-841) DateField selects wrong date if client is in a different timezone than the server

Posted by Cordenier Christophe <Ch...@atosorigin.com>.
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