$_SESSION["hasAudio"] = $_REQUEST["hasAudio"] === "true";
$_SESSION["hasSandbox"] = $_REQUEST["hasSandbox"] === "true";
$_SESSION["hasMp3"] = $_REQUEST["hasMp3"] === "true";
+ $_SESSION["clientTzOffset"] = $_REQUEST["clientTzOffset"];
$reply = array();
$user_tz_string = get_pref('USER_TIMEZONE', $owner_uid);
- try {
- if (!$user_tz) $user_tz = new DateTimeZone($user_tz_string);
- } catch (Exception $e) {
- $user_tz = $utc_tz;
- }
+ if ($user_tz_string != 'Automatic') {
- $tz_offset = $user_tz->getOffset($dt);
+ try {
+ if (!$user_tz) $user_tz = new DateTimeZone($user_tz_string);
+ } catch (Exception $e) {
+ $user_tz = $utc_tz;
+ }
+
+ $tz_offset = $user_tz->getOffset($dt);
+ } else {
+ $tz_offset = (int) $_SESSION["clientTzOffset"];
+ }
$user_timestamp = $dt->format('U') + $tz_offset;
dojo.addOnLoad(function() {
loading_set_progress(50);
+ var clientTzOffset = new Date().getTimezoneOffset() * 60;
+
new Ajax.Request("backend.php", {
- parameters: {op: "rpc", method: "sanityCheck"},
+ parameters: {op: "rpc", method: "sanityCheck",
+ clientTzOffset: clientTzOffset },
onComplete: function(transport) {
backend_sanity_check_callback(transport);
} });
var hasAudio = !!a.canPlayType;
var hasSandbox = "sandbox" in document.createElement("iframe");
var hasMp3 = !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
+ var clientTzOffset = new Date().getTimezoneOffset() * 60;
new Ajax.Request("backend.php", {
parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio,
hasMp3: hasMp3,
+ clientTzOffset: clientTzOffset,
hasSandbox: hasSandbox},
onComplete: function(transport) {
backend_sanity_check_callback(transport);
+Automatic
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa