Nico Klasens <[EMAIL PROTECTED]> wrote:

> Some weeks ago Martijn Houtman found a problem with the editwizards when a
> server is in a different timezone as the client. I made a fix for this,
but
> it is a big one. I would like some others to test my fix before I add it
to
> CVS (HEAD and MMBASE-1_7). It is very likely that I missed something.
> So could someone review the changes in the zip-file and let me know if
> everything is still working.
>
> The change is that dates and times are not sent in milliseconds to the
> client, but in separate numbers. Now the only timezone to deal with is the
> one of the server.
>
Hi Nico, I looked again to the code and I have the following idea to make
the timezone explicit, now you send the dates in separate numbers.

- Add a timezone parameter [EMAIL PROTECTED] This makes
complete clear what the date means.
- Add a timezone parameter to the EditWizard just like "debug=true" or
"origin=number". If this parameter is not present, it is default the server
timezone.
- When you receive the date you can use this timezone to translate it to
milliseconds. It is very simple to do in the java code, because you can use
Calendar.getInstance(timezone) instead of Calendar.getInstance().When you
send the date you can use setTimeZone(dateFormater, timezone).
- Change the date function in xslt to accept the timezone parameter.
- In list.jsp you can use the timezone parameter to present the dates.
- For insertion of a new date the extra timezone parameter can be set in
javascript (or you can assume it is default the server timezone, when it is
not present).

A nice thing about this setup is that all old code will still work. It will
be easy to add a list box that sets the timezone for a date that is edited
and EditWizards is ready for use in all timezones of the world. It is then
even possible to insert a list of dates that are in different timezones.

Martijn Houtman







Then


Reply via email to