summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-10-31 11:50:33 +0100
committerThomas Bruederli <thomas@roundcube.net>2012-10-31 11:50:33 +0100
commit086b153ae274e528e709d179795d0bafd5f382bd (patch)
tree932252c46cafcea76da0fc50bcf423626ec2a78c /program/js/app.js
parentdc6794f9c40be9a4aed6927faad85b95d7642369 (diff)
Improve client-side timezone detection using jsTimezoneDetect by Jon Nylander (#1488725); removed obsolete dstactive detection
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/program/js/app.js b/program/js/app.js
index c151a1012..6741a480e 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -424,12 +424,14 @@ function rcube_webmail()
$('#rcmloginpwd').focus();
// detect client timezone
- var dt = new Date(),
- tz = dt.getTimezoneOffset() / -60,
- stdtz = dt.getStdTimezoneOffset() / -60;
-
- $('#rcmlogintz').val(stdtz);
- $('#rcmlogindst').val(tz > stdtz ? 1 : 0);
+ if (window.jstz && !bw.ie6) {
+ var timezone = jstz.determine();
+ if (timezone.name())
+ $('#rcmlogintz').val(timezone.name());
+ }
+ else {
+ $('#rcmlogintz').val(new Date().getStdTimezoneOffset() / -60);
+ }
// display 'loading' message on form submit, lock submit button
$('form').submit(function () {