From 62fe162adfcabf5ee73394ddade85bdc14c305ee Mon Sep 17 00:00:00 2001 From: BafS Date: Fri, 19 Feb 2016 01:33:06 +0100 Subject: [PATCH] Simplify date handling Use date as string (timestamp if no date in the front matter) instead of `DateTime` object --- Parvula/Core/Model/Page.php | 4 ---- Parvula/routes/index.php | 2 -- 2 files changed, 6 deletions(-) diff --git a/Parvula/Core/Model/Page.php b/Parvula/Core/Model/Page.php index e750bf1..374a649 100644 --- a/Parvula/Core/Model/Page.php +++ b/Parvula/Core/Model/Page.php @@ -77,10 +77,6 @@ public function __construct(array $meta, $content = '', $sections = null) { $this->{$key} = $value; } - // date can be set after the creation, by the database or file last edit - if (!empty($this->date)) { - $this->date = new DateTime($this->date); - } $this->content = $content; $this->sections = (object) $sections; } diff --git a/Parvula/routes/index.php b/Parvula/routes/index.php index 2f7cf7e..0dd343b 100644 --- a/Parvula/routes/index.php +++ b/Parvula/routes/index.php @@ -37,8 +37,6 @@ } } - // Set the right timezone - $page->date->setTimeZone(new DateTimeZone($config->get('timezone', 'UTC'))); $plugins->trigger('page', [&$page]); try {