diff options
author | Simon Rettberg | 2018-02-12 18:49:36 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-02-12 18:49:36 +0100 |
commit | 556e7ee54269bd94bfb166bae59ef51ad93df8aa (patch) | |
tree | c52584716bbfab0f4a8f1662c7bbecf6097799b0 /modules-available/eventlog/page.inc.php | |
parent | [eventlog] Simplify permission check (diff) | |
download | slx-admin-556e7ee54269bd94bfb166bae59ef51ad93df8aa.tar.gz slx-admin-556e7ee54269bd94bfb166bae59ef51ad93df8aa.tar.xz slx-admin-556e7ee54269bd94bfb166bae59ef51ad93df8aa.zip |
[eventlog] Use Util::prettyTime for timestamp formatting
Diffstat (limited to 'modules-available/eventlog/page.inc.php')
-rw-r--r-- | modules-available/eventlog/page.inc.php | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/modules-available/eventlog/page.inc.php b/modules-available/eventlog/page.inc.php index c482eb93..1c81983c 100644 --- a/modules-available/eventlog/page.inc.php +++ b/modules-available/eventlog/page.inc.php @@ -13,19 +13,11 @@ class Page_EventLog extends Page protected function doRender() { Render::addTemplate("heading"); - $today = date('d.m.Y'); - $yesterday = date('d.m.Y', time() - 86400); $lines = array(); $paginate = new Paginate("SELECT logid, dateline, logtypeid, description, extra FROM eventlog ORDER BY logid DESC", 50); $res = $paginate->exec(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $day = date('d.m.Y', $row['dateline']); - if ($day === $today) { - $day = Dictionary::translate('lang_today'); - } elseif ($day === $yesterday) { - $day = Dictionary::translate('lang_yesterday'); - } - $row['date'] = $day . date(' H:i', $row['dateline']); + $row['date'] = Util::prettyTime($row['dateline']); $row['icon'] = $this->typeToIcon($row['logtypeid']); $row['color'] = $this->typeToColor($row['logtypeid']); $lines[] = $row; |