summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-02-08 17:37:13 -0500
committerFrederic Guillot <fred@kanboard.net>2015-02-08 17:37:13 -0500
commitd634a53e9c2c9b5c4dac6c701557f6b69dc06213 (patch)
tree20f40bd7e54a460778b3f47f8162d41319e63665 /app/Model
parent92509c43c452daea115a4f6e99d94bda5538c8f0 (diff)
Update moment.js and add timezone in template
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/Config.php22
-rw-r--r--app/Model/TaskFilter.php1
2 files changed, 17 insertions, 6 deletions
diff --git a/app/Model/Config.php b/app/Model/Config.php
index 542cedf7..48640f4e 100644
--- a/app/Model/Config.php
+++ b/app/Model/Config.php
@@ -202,18 +202,28 @@ class Config extends Base
}
/**
- * Set timezone
+ * Get current timezone
*
* @access public
+ * @return string
*/
- public function setupTimezone()
+ public function getCurrentTimezone()
{
if ($this->userSession->isLogged() && ! empty($this->session['user']['timezone'])) {
- date_default_timezone_set($this->session['user']['timezone']);
- }
- else {
- date_default_timezone_set($this->get('application_timezone', 'UTC'));
+ return $this->session['user']['timezone'];
}
+
+ return $this->get('application_timezone', 'UTC');
+ }
+
+ /**
+ * Set timezone
+ *
+ * @access public
+ */
+ public function setupTimezone()
+ {
+ date_default_timezone_set($this->getCurrentTimezone());
}
/**
diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php
index eac90aab..b5a90154 100644
--- a/app/Model/TaskFilter.php
+++ b/app/Model/TaskFilter.php
@@ -100,6 +100,7 @@ class TaskFilter extends Base
foreach ($this->query->findAll() as $task) {
$events[] = array(
+ 'timezoneParam' => $this->config->getCurrentTimezone(),
'id' => $task['id'],
'title' => t('#%d', $task['id']).' '.$task['title'],
'start' => date('Y-m-d', $task['date_due']),