From ed46aeb65ab196ca1a7affbbd288d7fbc05c1f2a Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 10 Feb 2023 22:37:51 +0100 Subject: [PATCH] Blog 6.5 Index date and time format okay Update to 6.5 okay --- module/blog/blog.php | 13 ++++++++++--- module/blog/changes.md | 2 +- module/blog/view/option/option.php | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/module/blog/blog.php b/module/blog/blog.php index 4645213c..98735505 100755 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -125,7 +125,7 @@ class blog extends common ]; public static $timeFormats = [ '%H:%M' => 'HH:MM', - '%I:%M:%S %p' => "HH:MM tt", + '%I:%M %p' => "HH:MM tt", ]; public static $timeFormat = ''; @@ -161,10 +161,17 @@ class blog extends common $this->setData(['module', $this->getUrl(0), 'config', 'articlesLenght', 0]); $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.0']); } + // Version 6.5 + if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.5', '<')) { + $this->setData(['module', $this->getUrl(0), 'config', 'dateFormat', '%d %B %Y']); + $this->setData(['module', $this->getUrl(0), 'config', 'timeFormat', '%H:%M']); + $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.5']); + } } + /** * Flux RSS */ @@ -538,8 +545,8 @@ class blog extends common 'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true), 'articlesLenght' => $this->getInput('blogOptionArticlesLenght', helper::FILTER_INT), 'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']), - 'dateFormat' => $this->getInput('blogOptionDateFormat', helper::FILTER_STRING_SHORT), - 'timeFormat' => $this->getInput('blogOptionTimeFormat', helper::FILTER_STRING_SHORT), + 'dateFormat' => $this->getInput('blogOptionDateFormat'), + 'timeFormat' => $this->getInput('blogOptionTimeFormat'), ]]); // Valeurs en sortie $this->addOutput([ diff --git a/module/blog/changes.md b/module/blog/changes.md index 935b441b..45de5c97 100755 --- a/module/blog/changes.md +++ b/module/blog/changes.md @@ -1,4 +1,4 @@ -# version 6.4 +# version 6.5 - Formats de date # version 6.4 - Multilingisme diff --git a/module/blog/view/option/option.php b/module/blog/view/option/option.php index 8a4b00b3..4cf5eae5 100755 --- a/module/blog/view/option/option.php +++ b/module/blog/view/option/option.php @@ -35,9 +35,9 @@ ]); ?>
- 'Format des heures', - 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']) + 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']) ]); ?>