diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2014-10-28 18:20:33 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2014-10-28 18:20:33 +0100 |
| commit | ce010bc12b8b0a03e662a2f4df984daa6d252fb8 (patch) | |
| tree | 4447d223d499cea9fcca0749039990f569117a4a /controller/guicontroller.php | |
| parent | 891db33ead914486b6f4f7e32ebd3a7f511562e8 (diff) | |
| download | grauphel-ce010bc12b8b0a03e662a2f4df984daa6d252fb8.tar.gz grauphel-ce010bc12b8b0a03e662a2f4df984daa6d252fb8.zip | |
color modified date as files app does it
Diffstat (limited to 'controller/guicontroller.php')
| -rw-r--r-- | controller/guicontroller.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/controller/guicontroller.php b/controller/guicontroller.php index 6fffcb2..127daaf 100644 --- a/controller/guicontroller.php +++ b/controller/guicontroller.php @@ -157,6 +157,17 @@ class GuiController extends Controller } ); + foreach ($notes as &$note) { + $diffInDays = intval( + (time() - strtotime($note['last-change-date'])) / 86400 + ); + $value = 0 + $diffInDays; + if ($value > 160) { + $value = 160; + } + $note['dateColor'] = '#' . str_repeat(sprintf('%02X', $value), 3); + } + $res = new TemplateResponse('grauphel', 'tag'); $res->setParams( array( |
