summaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorFrédéric Guillot <contact@fredericguillot.com>2014-02-24 18:08:58 -0500
committerFrédéric Guillot <contact@fredericguillot.com>2014-02-24 18:08:58 -0500
commit64e2e072294563b7c834382c2de631687f235fe8 (patch)
treecdfc0e7ae9b72e2d6166376a8c757a0325152c30 /models
parente374a6fd6499b50d4587d136490ced7444f8bc2b (diff)
Improve timezone pull-request and settings page
Diffstat (limited to 'models')
-rw-r--r--models/config.php6
-rw-r--r--models/schema.php5
2 files changed, 7 insertions, 4 deletions
diff --git a/models/config.php b/models/config.php
index f4d34986..a00d0b7e 100644
--- a/models/config.php
+++ b/models/config.php
@@ -9,6 +9,12 @@ class Config extends Base
{
const TABLE = 'config';
+ public function getTimezones()
+ {
+ $timezones = \timezone_identifiers_list();
+ return array_combine(array_values($timezones), $timezones);
+ }
+
public function getLanguages()
{
$languages = array(
diff --git a/models/schema.php b/models/schema.php
index 3704aad1..66571bbe 100644
--- a/models/schema.php
+++ b/models/schema.php
@@ -4,10 +4,7 @@ namespace Schema;
function version_4($pdo)
{
- $pdo->exec('ALTER TABLE config ADD column timezone TEXT');
-
- //set default timezone to UTC
- $pdo->exec('UPDATE config SET timezone = \'UTC\'');
+ $pdo->exec("ALTER TABLE config ADD column timezone TEXT DEFAULT 'UTC'");
}
function version_3($pdo)