You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by "seba.wagner@gmail.com" <se...@gmail.com> on 2013/08/03 02:38:27 UTC
Submitting a DateTextField value in a different timezone that the browser
Hi,
According to:
http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/datetime/markup/html/form/DateTextField.html
*This component tries to apply the time zone difference between the client
and server. See the date
converter<http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/datetime/DateConverter.html#getApplyTimeZoneDifference%28%29>of
this package for more information on that.*
In our application users can configure the timezone of the UI different
from the browser/client/os timezone.
Apart from the reasons when and how and why we are doing that ...
Is there a way to configure the DateTextField to use a different timezone
then the clients/browser/os one for its calculations?
My basic idea is to overwrite the method "getClientTimeZone" in the
DateTimeField.
I wonder if that is the appropriate way to do it?
Are there other ideas or pointers how to resolve that?
Thanks,
Sebastian
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
Re: Submitting a DateTextField value in a different timezone that the browser
Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Thanks François
2013/8/3 Francois Meillet <fr...@gmail.com>
> Overriding the getClientTimeZone() method in the dateconverter sounds good.
> if the boolean applyTimeZoneDifference of the dateConverter is set to true.
>
> add(new DateTextField("xxx", new DateConverter(true) {
> @Override
> public String getDatePattern(Locale locale) {
> // ...
> }
>
> @Override
> protected DateTimeFormatter getFormat(Locale locale) {
> // ...
> }
>
> protected TimeZone getClientTimeZone() {
> return "yourspecifictimezone";
> }
>
> }));
>
>
> François
>
>
>
> Le 3 août 2013 à 02:38, seba.wagner@gmail.com a écrit :
>
> > Hi,
> >
> > According to:
> >
> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/datetime/markup/html/form/DateTextField.html
> >
> > *This component tries to apply the time zone difference between the
> client
> > and server. See the date
> > converter<
> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/datetime/DateConverter.html#getApplyTimeZoneDifference%28%29
> >of
> > this package for more information on that.*
> >
> > In our application users can configure the timezone of the UI different
> > from the browser/client/os timezone.
> >
> > Apart from the reasons when and how and why we are doing that ...
> >
> > Is there a way to configure the DateTextField to use a different timezone
> > then the clients/browser/os one for its calculations?
> >
> > My basic idea is to overwrite the method "getClientTimeZone" in the
> > DateTimeField.
> > I wonder if that is the appropriate way to do it?
> >
> > Are there other ideas or pointers how to resolve that?
> >
> > Thanks,
> > Sebastian
> >
> > --
> > Sebastian Wagner
> > https://twitter.com/#!/dead_lock
> > http://www.webbase-design.de
> > http://www.wagner-sebastian.com
> > seba.wagner@gmail.com
>
>
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
Re: Submitting a DateTextField value in a different timezone that the browser
Posted by Francois Meillet <fr...@gmail.com>.
Overriding the getClientTimeZone() method in the dateconverter sounds good.
if the boolean applyTimeZoneDifference of the dateConverter is set to true.
add(new DateTextField("xxx", new DateConverter(true) {
@Override
public String getDatePattern(Locale locale) {
// ...
}
@Override
protected DateTimeFormatter getFormat(Locale locale) {
// ...
}
protected TimeZone getClientTimeZone() {
return "yourspecifictimezone";
}
}));
François
Le 3 août 2013 à 02:38, seba.wagner@gmail.com a écrit :
> Hi,
>
> According to:
> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/datetime/markup/html/form/DateTextField.html
>
> *This component tries to apply the time zone difference between the client
> and server. See the date
> converter<http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/datetime/DateConverter.html#getApplyTimeZoneDifference%28%29>of
> this package for more information on that.*
>
> In our application users can configure the timezone of the UI different
> from the browser/client/os timezone.
>
> Apart from the reasons when and how and why we are doing that ...
>
> Is there a way to configure the DateTextField to use a different timezone
> then the clients/browser/os one for its calculations?
>
> My basic idea is to overwrite the method "getClientTimeZone" in the
> DateTimeField.
> I wonder if that is the appropriate way to do it?
>
> Are there other ideas or pointers how to resolve that?
>
> Thanks,
> Sebastian
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com