Hi Devs,
I'm currently implementing Timezone support in my calendar plugin. I think this should be integrated with Roundcube Timezone settings.
Is there a special reason why you save only the offset and DST in prefs?
This way I can't detect the appropriate Olson Timezone: F.e.: America/Denver and America/Phoenix are both in GMT offset -07:00, Denver use DST while Phoenix doesn't.
I really would like to see the Timezone selection list showing Olson Timezone identifiers [timezone_identifiers_list()].
This change would it make possible to detect DST automatically as well ...
$stz = date_default_timezone_get(); date_default_timezone_set( ... indentifier from config ...); $is_dst(date('I', time()); date_default_timezone_set($stz);
Regards, R.
List info: http://lists.roundcube.net/dev/ BT/aba52c80
On 05.12.2011, at 16:21, Roland Liebl wrote:
Hi Devs,
I'm currently implementing Timezone support in my calendar plugin. I think this should be integrated with Roundcube Timezone settings.
Is there a special reason why you save only the offset and DST in prefs?
There's no special reason but just historic stupidness. Up until now it was enough because the only purpose of the timezone setting was to translate email dates to display.
I also worked on a calendar plugin and came across the same problems. To get one step closer we meanwhile distinguish between Timezone and DST which allows you to select a timezone from the Olson database using the these two offsets:
$timezone = $this->rc->config->get('timezone'); $dst_active = $this->rc->config->get('dst_active'); $gmt_offset = ($timezone + $dst_active) * 3600; $user_timezone = new DateTimeZone($timezone ? timezone_name_from_abbr("", $gmt_offset, $dst_active) : 'GMT');
Feel free to make the necessary changes to the Roundcube core in order to have a proper timezone support. You will, however, face some difficulties when one uses "automatic" setting and the timezone has to be taken from the client browser. There we only have very limited means of reading the actual timezone settings.
Regards, Thomas
List info: http://lists.roundcube.net/dev/ BT/aba52c80
Feel free to make the necessary changes to the Roundcube core in order to have a proper timezone support. You will, however, face some difficulties when one uses "automatic" setting and the timezone has to be taken from the client browser. There we only have very limited means of reading the actual timezone settings.
Here is my patch. Maybe it is a little bit overdone, but I tried to implement backwards compatibility.
You can test it live @ http://svn.mail4us.net
Regards, Roland
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/u3/RxeaVfWs/timezone.diff Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/ BT/aba52c80
Feel free to make the necessary changes to the Roundcube core in order to have a proper timezone support. You will, however, face some difficulties when one uses "automatic" setting and the timezone has to be taken from the client browser. There we only have very limited means of reading the actual timezone settings.
A tiny improvement ... It does not make sense to condider DST active in the backwards compatibilty part as DST is detected automatically.
The patch is created against Roundcube 0.6. I hope you like it!
Regards, Roland
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/Uy/6u39FVQJ/timezone.diff Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Mon, 05 Dec 2011 14:01:56 -2000, Roland Liebl wrote:
The patch is created against Roundcube 0.6. I hope you like it!
this mail have
Date: Mon, 05 Dec 2011 14:01:56 -2000
its even a spamassassin test now :(
List info: http://lists.roundcube.net/dev/ BT/aba52c80
Feel free to make the necessary changes to the Roundcube core in order to have a proper timezone support. You will, however, face some difficulties when one uses "automatic" setting and the timezone has to be taken from the client browser. There we only have very limited means of reading the actual timezone settings.
Again a modified patch (reset of timezone was incorrect).
@ Benny Pedersen:
Could you please be more detailed? I don't get your problem.
Regards, Roland
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/uW/g4pnFvnf/timezone.diff Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/ BT/aba52c80
Am 06.12.2011 11:10, schrieb Benny Pedersen:
On Mon, 05 Dec 2011 14:01:56 -2000, Roland Liebl wrote:
The patch is created against Roundcube 0.6. I hope you like it!
this mail have
Date: Mon, 05 Dec 2011 14:01:56 -2000
its even a spamassassin test now :(
May be issue was caused due to incorrect timezone reset. Test new patch, please!
List info: http://lists.roundcube.net/dev/ BT/8d1870bd
List info: http://lists.roundcube.net/dev/ BT/aba52c80
Feel free to make the necessary changes to the Roundcube core in order to have a proper timezone support. You will, however, face some difficulties when one uses "automatic" setting and the timezone has to be taken from the client browser. There we only have very limited means of reading the actual timezone settings.
Better display/sorting ...
OK, done for now. Please test!
Regards, Roland
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/Ts/WP9Pyjb6/timezone.diff Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Tue, 06 Dec 2011 11:16:31 +0100, Roland Liebl wrote:
Could you please be more detailed? I don't get your problem.
seems solved here, not listed -2000 anymore _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Tue, 06 Dec 2011 11:23:33 +0100, Roland Liebl wrote:
May be issue was caused due to incorrect timezone reset. Test new patch, please!
not needed here _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80
Hello all,
I now refactored timezone handling in Roundcube (see http://trac.roundcube.net/changeset/5707) to add proper timezone support to it.
The big change is that $rcmail->config->get('timezone') no longer returns an integer value with the timezone offset in hours but the timezone identifier as string. That one can be used to create a DateTimeZone object for date calculation or formatting.
Plugin developers who made use of the 'timezone' config property therefore need to adjust their code. With this change, the 'dst_active' config option no longer exists.
I hope this helps to make date calculations easier for the future.
Regards, Thomas
Thomas Bruederli wrote:
On 05.12.2011, at 16:21, Roland Liebl wrote:
Hi Devs,
I'm currently implementing Timezone support in my calendar plugin. I think this should be integrated with Roundcube Timezone settings.
Is there a special reason why you save only the offset and DST in prefs?
There's no special reason but just historic stupidness. Up until now it was enough because the only purpose of the timezone setting was to translate email dates to display.
I also worked on a calendar plugin and came across the same problems. To get one step closer we meanwhile distinguish between Timezone and DST which allows you to select a timezone from the Olson database using the these two offsets:
$timezone = $this->rc->config->get('timezone'); $dst_active = $this->rc->config->get('dst_active'); $gmt_offset = ($timezone + $dst_active) * 3600; $user_timezone = new DateTimeZone($timezone ? timezone_name_from_abbr("", $gmt_offset, $dst_active) : 'GMT');
Feel free to make the necessary changes to the Roundcube core in order to have a proper timezone support. You will, however, face some difficulties when one uses "automatic" setting and the timezone has to be taken from the client browser. There we only have very limited means of reading the actual timezone settings.
Regards, Thomas
List info: http://lists.roundcube.net/dev/ BT/aba52c80