Skip to content

Commit

Permalink
Simplify date handling
Browse files Browse the repository at this point in the history
Use date as string (timestamp if no date in the front matter) instead
of `DateTime` object
  • Loading branch information
BafS committed Feb 19, 2016
1 parent c3f2862 commit 62fe162
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
4 changes: 0 additions & 4 deletions Parvula/Core/Model/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 0 additions & 2 deletions Parvula/routes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
}
}

// Set the right timezone
$page->date->setTimeZone(new DateTimeZone($config->get('timezone', 'UTC')));
$plugins->trigger('page', [&$page]);

try {
Expand Down

0 comments on commit 62fe162

Please sign in to comment.