openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 39fd717b0851d9c0d177c563c7a9c3b65026f39c
parent 55ae6410e625a178c2da1f218917ca5bfecc5086
Author: dankert <openrat@jandankert.de>
Date:   Sun,  5 Dec 2021 22:52:08 +0100

Fix: Condider dates in future.

Diffstat:
Mmodules/template_engine/components/html/component_date/component-date.php | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/template_engine/components/html/component_date/component-date.php b/modules/template_engine/components/html/component_date/component-date.php @@ -41,7 +41,10 @@ function component_date($time ) ]; echo ' ('; - + + if ( time()<$time) + echo "+"; + foreach ( $units as $unit ) { if ( $past == 1 ) { echo $past.' '.Output::lang($unit[1] ); @@ -62,7 +65,7 @@ function component_date($time ) echo ' datetime="'.date('c',$time).'"'; echo '>'; - $format = (\cms\base\Startup::getStartTime()-$time)>(60*60*24)?Messages::DATE_FORMAT:Messages::DATE_FORMAT_TODAY; + $format = abs(\cms\base\Startup::getStartTime()-$time)>(60*60*24)?Messages::DATE_FORMAT:Messages::DATE_FORMAT_TODAY; echo date( Output::lang($format),$time ); echo '</time>'; }