From b7153296335e0cf6ba3e6547128d1eec6a8093fe Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 17 Feb 2023 14:30:36 +0100 Subject: [PATCH] Blog and news add zero seconds --- module/blog/view/add/add.php | 3 ++- module/news/view/add/add.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/blog/view/add/add.php b/module/blog/view/add/add.php index 793001a2..e099ee20 100755 --- a/module/blog/view/add/add.php +++ b/module/blog/view/add/add.php @@ -90,7 +90,8 @@ 'help' => 'L\'article n\'est visible qu\'après la date de publication prévue.', 'label' => 'Date de publication', 'type' => 'datetime-local', - 'value' => time() + 'format' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']) . $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']), + 'value' => floor(strtotime('now') / 60) * 60 ]); ?>
diff --git a/module/news/view/add/add.php b/module/news/view/add/add.php index 64b234f9..d1005cc3 100644 --- a/module/news/view/add/add.php +++ b/module/news/view/add/add.php @@ -52,7 +52,7 @@ 'help' => 'La news est consultable à partir du moment ou la date de publication est passée.', 'label' => 'Date de publication', 'type' => 'datetime-local', - 'value' => time() + 'value' => floor(strtotime('now') / 60) * 60 ]); ?>
@@ -60,7 +60,7 @@ 'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de dépublication, sélectionnez une date antérieure à la publication.', 'label' => 'Date de dépublication', 'type' => 'datetime-local', - 'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff']) + 'value' => '' ]); ?>