aboutsummaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-06-05 15:13:03 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-06-05 15:13:03 +0200
commitd65f8bba73971e33a93e99d21ba791dec8056a28 (patch)
treec2d6c44d1a1b79849787ccc6d738c071e659421d /files
parentbc0790381e9cf02545bf4b2945c70c246008671f (diff)
downloadnextcloud-server-d65f8bba73971e33a93e99d21ba791dec8056a28.tar.gz
nextcloud-server-d65f8bba73971e33a93e99d21ba791dec8056a28.zip
try to adjust times to the clients timezone
Diffstat (limited to 'files')
-rw-r--r--files/ajax/timezone.php4
-rw-r--r--files/index.php3
-rw-r--r--files/js/timezone.js12
3 files changed, 19 insertions, 0 deletions
diff --git a/files/ajax/timezone.php b/files/ajax/timezone.php
new file mode 100644
index 00000000000..93d06611a0d
--- /dev/null
+++ b/files/ajax/timezone.php
@@ -0,0 +1,4 @@
+<?php
+ session_start();
+ $_SESSION['timezone'] = $_GET['time'];
+?> \ No newline at end of file
diff --git a/files/index.php b/files/index.php
index d796583a4ae..a163895131e 100644
--- a/files/index.php
+++ b/files/index.php
@@ -37,6 +37,9 @@ OC_UTIL::addStyle( "files", "files" );
OC_UTIL::addScript( "files", "files" );
OC_UTIL::addScript( 'files', 'filelist' );
OC_UTIL::addScript( 'files', 'fileactions' );
+if(!isset($_SESSION['timezone'])){
+ OC_UTIL::addScript( 'files', 'timezone' );
+}
OC_APP::setActiveNavigationEntry( "files_index" );
// Load the files
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
diff --git a/files/js/timezone.js b/files/js/timezone.js
new file mode 100644
index 00000000000..d569683f210
--- /dev/null
+++ b/files/js/timezone.js
@@ -0,0 +1,12 @@
+//send the clients time zone to the server
+$(document).ready(function() {
+ var visitortimezone = (-new Date().getTimezoneOffset()/60);
+ $.ajax({
+ type: "GET",
+ url: "ajax/timezone.php",
+ data: 'time='+ visitortimezone,
+ success: function(){
+ location.reload();
+ }
+ });
+}); \ No newline at end of file