diff --git a/src/bb-config-sample.php b/src/bb-config-sample.php index 92c8dd17c..1d4bdb510 100755 --- a/src/bb-config-sample.php +++ b/src/bb-config-sample.php @@ -76,16 +76,16 @@ return [ /** * Set default date format for localized strings. * - * @see http://php.net/manual/en/function.strftime.php + * @see https://www.php.net/manual/en/datetime.format.php */ - 'locale_date_format' => '%A, %d %B %G', + 'locale_date_format' => 'l, d F o', /** * Set default time format for localized strings. * - * @see http://php.net/manual/en/function.strftime.php + * @see https://www.php.net/manual/en/datetime.format.php */ - 'locale_time_format' => ' %T', + 'locale_time_format' => ' G:i:s', /** * Set location to store sensitive data. diff --git a/src/bb-library/Box/TwigExtensions.php b/src/bb-library/Box/TwigExtensions.php index 4527b5ca1..aa4e6df45 100644 --- a/src/bb-library/Box/TwigExtensions.php +++ b/src/bb-library/Box/TwigExtensions.php @@ -98,7 +98,7 @@ class Box_TwigExtensions extends AbstractExtension implements InjectionAwareInte $locale_date_format = $this->di['config']['locale_date_format']; $format = is_null($format) ? $locale_date_format : $format; - return strftime($format, strtotime($time)); + return date($format, strtotime($time)); } public function twig_bb_datetime($time, $format = null) @@ -107,7 +107,7 @@ class Box_TwigExtensions extends AbstractExtension implements InjectionAwareInte $locale_time_format = $this->di['config']['locale_time_format']; $format = is_null($format) ? $locale_date_format.$locale_time_format : $format; - return strftime($format, strtotime($time)); + return date($format, strtotime($time)); } public function twig_ipcountryname_filter($value) diff --git a/src/bb-modules/Invoice/Service.php b/src/bb-modules/Invoice/Service.php index 7dffa3d8b..eb542e4b9 100644 --- a/src/bb-modules/Invoice/Service.php +++ b/src/bb-modules/Invoice/Service.php @@ -1303,12 +1303,11 @@ class Service implements InjectionAwareInterface $html .= ""; $html .= '
'; } - $invoiceDate = strftime($localeDateFormat, strtotime($this->di['array_get']($invoice, 'due_at', $invoice['created_at']))); $html .= '
'; $html .= '

Invoice number: ' . $invoice['serie_nr'] . '

'; - $html .= '

Invoice date: ' . $invoiceDate . '

'; - $html .= '

Due date: ' . strftime($localeDateFormat, strtotime($invoice['due_at'])) . '

'; + $html .= '

Invoice date: ' . date($localeDateFormat, strtotime($invoice['created_at'])) . '

'; + $html .= '

Due date: ' . date($localeDateFormat, strtotime($invoice['due_at'])) . '

'; $html .= '

Invoice status: ' . ucfirst($invoice['status']) . '

'; $html .= '
'; diff --git a/src/install/install.php b/src/install/install.php index a8bf0e666..88abffe9f 100644 --- a/src/install/install.php +++ b/src/install/install.php @@ -412,8 +412,8 @@ final class Box_Installer 'sef_urls' => true, 'timezone' => 'UTC', 'locale' => 'en_US', - 'locale_date_format' => '%A, %d %B %G', - 'locale_time_format' => ' %T', + 'locale_date_format' => 'l, d F o', + 'locale_time_format' => ' G:i:s', 'path_data' => BB_PATH_ROOT . '/bb-data', 'path_logs' => BB_PATH_ROOT . '/bb-data/log/application.log', diff --git a/tests/integration/bb-modules/mod_system/Api_AdminTest.php b/tests/integration/bb-modules/mod_system/Api_AdminTest.php index bb38ca030..7a74ee6e6 100644 --- a/tests/integration/bb-modules/mod_system/Api_AdminTest.php +++ b/tests/integration/bb-modules/mod_system/Api_AdminTest.php @@ -116,7 +116,7 @@ class Api_Admin_SystemTest extends BBDbApiTestCase public function testRenderDate() { - $result = strftime($this->di['config']['locale_date_format']); + $result = date($this->di['config']['locale_date_format']); $data = [ 'id' => 1, '_tpl' => '{{ now|date("Y-m-d")|bb_date }}',