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 --- app-from-scratch.sh | 6 ++++++ fai_gestion/config/app.php | 1 + fai_gestion/config/bootstrap.php | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app-from-scratch.sh b/app-from-scratch.sh index 074d258..ec573e6 100644 --- a/app-from-scratch.sh +++ b/app-from-scratch.sh @@ -240,3 +240,9 @@ editor config/routes.php git add ../app-from-scratch.sh config/routes.php git add src/Model/Entity/empty src/Model/Table/empty tests/Fixture/empty git commit -m "first cake bake, auto-generated files not included for now" +# 18507a4c76abad7cf5e6e9572137d0dc5a977fcc + +# Adding debug tool, tweaking date formatting +editor config/app.php config/bootstrap.php +git add ../app-from-scratch.sh config/app.php config/bootstrap.php +git commit -m "Adding debug tool, tweaking date formatting" diff --git a/fai_gestion/config/app.php b/fai_gestion/config/app.php index 0a913ab..8a858e8 100644 --- a/fai_gestion/config/app.php +++ b/fai_gestion/config/app.php @@ -10,6 +10,7 @@ return [ * true: Errors and warnings shown. */ 'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN), + 'DebugKit.forceEnable' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN), /** * Configure basic information about the application. 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