Try a fix when timezone string is not standard

Conflicts:
	htdocs/includes/adodbtime/adodb-time.inc.php
This commit is contained in:
Laurent Destailleur
2014-07-04 13:07:53 +02:00
committed by Laurent Destailleur
parent 863d57004e
commit 6a61587085
3 changed files with 30 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net>
// Copyright (C) 2011-2014 Laurent Destailleur <eldy@users.sourceforge.net>
// Copyright (C) 2011-2012 Regis Houssin <regis.houssin@capnetworks.com>
//
// This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,8 @@
//
// \file htdocs/core/js/dst.js
// \brief File that include javascript functions for detect user tz, dst_observed, dst_first, dst_second
// \brief File that include javascript functions for detect user tz, tz_string, dst_observed, dst_first, dst_second,
// screenwidth and screenheight
//
$(document).ready(function () {
@@ -39,22 +40,22 @@ $(document).ready(function () {
dst = "1"; // daylight savings time is observed
}
var now=new Date();
var tz=now.toTimeString().match(/\(.*\)/);
var tz=now.toTimeString().match(/\(.*\)/); // now.toTimeString may return "12:39:59 GMT+0200 (CEST)"
//alert('date=' + now + ' string=' + now.toTimeString());
var dst_first=DisplayDstSwitchDates('first');
var dst_second=DisplayDstSwitchDates('second');
//alert(dst);
$('#tz').val(std_time_offset); // returns TZ
// tz is null with IE
$('#tz').val(std_time_offset); // returns TZ
// tz is null with IE
if (tz != null) {
$('#tz_string').val(tz[0].replace('(','').replace(')','')); // returns TZ string
}
$('#dst_observed').val(dst); // returns if DST is observed on summer
$('#dst_first').val(dst_first); // returns DST first switch in year
$('#dst_second').val(dst_second); // returns DST second switch in year
$('#dst_observed').val(dst); // returns if DST is observed on summer
$('#dst_first').val(dst_first); // returns DST first switch in year
$('#dst_second').val(dst_second); // returns DST second switch in year
// Detect and save screen resolution
$('#screenwidth').val($(window).width()); // returns width of browser viewport
$('#screenheight').val($(window).height()); // returns width of browser viewport
$('#screenwidth').val($(window).width()); // returns width of browser viewport
$('#screenheight').val($(window).height()); // returns width of browser viewport
});
function DisplayDstSwitchDates(firstsecond)