From 502b75e4de074618c443edad7b801b7e3a159ce2 Mon Sep 17 00:00:00 2001 From: E <2974895+eduardomozart@users.noreply.github.com> Date: Wed, 22 Jul 2026 16:58:56 -0300 Subject: [PATCH] Fix @DATE()@ formatting and replace strftime with dformat --- src/Template.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Template.php b/src/Template.php index 641ac1b..0b167c8 100644 --- a/src/Template.php +++ b/src/Template.php @@ -152,11 +152,11 @@ protected function replacePlaceholders(string $html): string '/@DATE\((.*?)(?:,\s*(.*?))?\)@/', function ($match) { global $conf; + $date = ($match[1] === '@DATE@') ? time() : strtotime($match[1]); + //no 2nd argument for default date format - if ($match[2] == null) { - $match[2] = $conf['dformat']; - } - return strftime($match[2], strtotime($match[1])); + $format = empty($match[2]) ? $conf['dformat'] : $match[2]; + return dformat($date, $format); }, $html );