Update moment.js and add timezone in template
This commit is contained in:
parent
92509c43c4
commit
d634a53e9c
|
|
@ -610,6 +610,17 @@ class Helper
|
|||
return $this->config->getJsLanguageCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current timezone
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getTimezone()
|
||||
{
|
||||
return $this->config->getCurrentTimezone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the link to toggle subtask status
|
||||
*
|
||||
|
|
|
|||
|
|
@ -201,6 +201,21 @@ class Config extends Base
|
|||
Translator::load($this->getCurrentLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current timezone
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrentTimezone()
|
||||
{
|
||||
if ($this->userSession->isLogged() && ! empty($this->session['user']['timezone'])) {
|
||||
return $this->session['user']['timezone'];
|
||||
}
|
||||
|
||||
return $this->get('application_timezone', 'UTC');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set timezone
|
||||
*
|
||||
|
|
@ -208,12 +223,7 @@ class Config extends Base
|
|||
*/
|
||||
public function setupTimezone()
|
||||
{
|
||||
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'));
|
||||
}
|
||||
date_default_timezone_set($this->getCurrentTimezone());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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']),
|
||||
|
|
|
|||
|
|
@ -25,7 +25,11 @@
|
|||
|
||||
<title><?= isset($title) ? $this->e($title) : 'Kanboard' ?></title>
|
||||
</head>
|
||||
<body data-status-url="<?= $this->u('app', 'status') ?>" data-login-url="<?= $this->u('user', 'login') ?>" data-js-lang="<?= $this->jsLang() ?>">
|
||||
<body data-status-url="<?= $this->u('app', 'status') ?>"
|
||||
data-login-url="<?= $this->u('user', 'login') ?>"
|
||||
data-timezone="<?= $this->getTimezone() ?>"
|
||||
data-js-lang="<?= $this->jsLang() ?>">
|
||||
|
||||
<?php if (isset($no_layout) && $no_layout): ?>
|
||||
<?= $content_for_layout ?>
|
||||
<?php else: ?>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -70,6 +70,7 @@ Kanboard.Calendar = (function() {
|
|||
lang: $("body").data("js-lang"),
|
||||
editable: true,
|
||||
eventLimit: true,
|
||||
defaultView: "agendaWeek",
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue