From eeb6aee61bc55a95a4d62d354f180d167c6a25fb Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Mon, 16 Jul 2018 15:38:11 +0200 Subject: Adding debug tool, tweaking date formatting --- fai_gestion/config/bootstrap.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'fai_gestion/config/bootstrap.php') diff --git a/fai_gestion/config/bootstrap.php b/fai_gestion/config/bootstrap.php index b68fbc9..24f6908 100644 --- a/fai_gestion/config/bootstrap.php +++ b/fai_gestion/config/bootstrap.php @@ -43,6 +43,8 @@ use Cake\Log\Log; use Cake\Mailer\Email; use Cake\Utility\Inflector; use Cake\Utility\Security; +use Cake\I18n\FrozenDate; +use Cake\I18n\FrozenTime; /** * Uncomment block of code below if you want to use `.env` file during development. @@ -185,9 +187,12 @@ Type::build('time') Type::build('date') ->useImmutable(); Type::build('datetime') - ->useImmutable()->useLocaleParser()->setLocaleFormat('yyyy-MM-dd'); + ->useImmutable(); Type::build('timestamp') ->useImmutable(); +// https://book.cakephp.org/3.0/en/core-libraries/time.html#setting-the-default-locale-and-format-string +FrozenTime::setToStringFormat('yyyy-MM-dd'); // For any immutable DateTime +FrozenDate::setToStringFormat('yyyy-MM-dd'); // For any immutable Date /* * Custom Inflector rules, can be set to correctly pluralize or singularize -- cgit v1.1