Re: [development] code proposal: localization of currency, ...
No, the autotimezone module automatically sets the timezone offset using a fairly simple bit of javascript to automatically update the timezone offset in the user record. I'm talking about the timezone name. There is no javascript-only way to identify and set the timezone name from browser information. In fact, I spent quite a bit of time researching how to do it since the common wisdom is that it can't be done at all. But I finally stumbled on a way to do it with a combination of javascript and PHP5 by building on some example code from a presentation made by Derick Rethans (the maintainer of the PHP5 date functions). Plus, to do anything useful with the user timezone name, you also have to overload the site and user timezone settings to select and store the timezone name instead of the offset, and to do that you have to have a way to manipulate timezone names and offsets to present the selection list. And then of course you need new ways of manipulating dates that use the timezone name instead of the offset to do timezone conversions. I put this in the Date API because it all works together -- you need the PHP5 date functions or their equivalents to detect and store the timezone name, and you need a different way of handling dates to do anything useful and reliable with the timezone name once you have it. I can propose patches for the autotimezone module, but they would be radical changes to the way the module works. It would have to be something like a completely new version of the module that requires PHP5, that both updates the offset as is done now for backwards compatibility with with old-style date handling but which also detects and stores the timezone name for applications that can use that information. And it would have to overload the user and site timezone handling forms to list and store timezone names instead of offsets. And autotimezone would then become a required module for any application that wants to use PHP5 date handling or store timezone names in user records. If it seems like this belongs in autotimezone, I can propose patches to it. Karen ----- Original Message ---- From: Moshe Weitzman <weitzman@tejasa.com> To: development@drupal.org Sent: Monday, October 22, 2007 7:18:17 PM Subject: Re: [development] code proposal: localization of currency, ... @karen - I suspect you have reimplemented autotimezone module - http://drupal.org/project/autotimezone. if you have any improvements, consider posting them in its issue queue.
Oh thanks, I get it now ... No, please ignore my mumblings. Keep this code in date api or wherever you deem best. Autotimezone shou;d just drift away and point to your work. On 10/22/07, Karen Stevenson <karen@elderweb.com> wrote:
No, the autotimezone module automatically sets the timezone offset using a fairly simple bit of javascript to automatically update the timezone offset in the user record. I'm talking about the timezone name. There is no javascript-only way to identify and set the timezone name from browser information. In fact, I spent quite a bit of time researching how to do it since the common wisdom is that it can't be done at all. But I finally stumbled on a way to do it with a combination of javascript and PHP5 by building on some example code from a presentation made by Derick Rethans (the maintainer of the PHP5 date functions).
Plus, to do anything useful with the user timezone name, you also have to overload the site and user timezone settings to select and store the timezone name instead of the offset, and to do that you have to have a way to manipulate timezone names and offsets to present the selection list. And then of course you need new ways of manipulating dates that use the timezone name instead of the offset to do timezone conversions.
I put this in the Date API because it all works together -- you need the PHP5 date functions or their equivalents to detect and store the timezone name, and you need a different way of handling dates to do anything useful and reliable with the timezone name once you have it.
I can propose patches for the autotimezone module, but they would be radical changes to the way the module works. It would have to be something like a completely new version of the module that requires PHP5, that both updates the offset as is done now for backwards compatibility with with old-style date handling but which also detects and stores the timezone name for applications that can use that information. And it would have to overload the user and site timezone handling forms to list and store timezone names instead of offsets. And autotimezone would then become a required module for any application that wants to use PHP5 date handling or store timezone names in user records.
If it seems like this belongs in autotimezone, I can propose patches to it.
Karen
----- Original Message ---- From: Moshe Weitzman <weitzman@tejasa.com> To: development@drupal.org Sent: Monday, October 22, 2007 7:18:17 PM Subject: Re: [development] code proposal: localization of currency, ...
@karen - I suspect you have reimplemented autotimezone module - http://drupal.org/project/autotimezone. if you have any improvements, consider posting them in its issue queue.
participants (2)
-
Karen Stevenson -
Moshe Weitzman