From 5b8d2f214c9f59cdca05e6925a40be897282353d Mon Sep 17 00:00:00 2001 From: Marcin Lawniczak Date: Tue, 26 Jul 2016 17:43:09 +0200 Subject: [PATCH] Add the ability to change date format in config. Implements #108. --- resources/DirectoryLister.php | 4 ++-- resources/default.config.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/DirectoryLister.php b/resources/DirectoryLister.php index c038008d8..d72ff11be 100644 --- a/resources/DirectoryLister.php +++ b/resources/DirectoryLister.php @@ -600,7 +600,7 @@ protected function _readDirectory($directory, $sort = 'natcase') { 'file_path' => $this->_appURL . $directoryPath, 'url_path' => $this->_appURL . $directoryPath, 'file_size' => '-', - 'mod_time' => date('Y-m-d H:i:s', filemtime($realPath)), + 'mod_time' => date($this->_config['date_display'], filemtime($realPath)), 'icon_class' => 'fa-level-up', 'sort' => 0 ); @@ -625,7 +625,7 @@ protected function _readDirectory($directory, $sort = 'natcase') { 'file_path' => $relativePath, 'url_path' => $urlPath, 'file_size' => is_dir($realPath) ? '-' : $this->getFileSize($realPath), - 'mod_time' => date('Y-m-d H:i:s', filemtime($realPath)), + 'mod_time' => date($this->_config['date_display'], filemtime($realPath)), 'icon_class' => $iconClass, 'sort' => $sort ); diff --git a/resources/default.config.php b/resources/default.config.php index 4cf51d6bb..52626d269 100644 --- a/resources/default.config.php +++ b/resources/default.config.php @@ -8,6 +8,8 @@ 'list_sort_order' => 'natcasesort', 'theme_name' => 'bootstrap', 'external_links_new_window' => true, + // Format of date display, see: http://php.net/manual/en/function.date.php + 'date_display' => 'Y-m-d H:i:s', // Hidden files 'hidden_files' => array(