summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2018-07-16 15:38:11 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2018-07-16 15:38:11 +0200
commiteeb6aee61bc55a95a4d62d354f180d167c6a25fb (patch)
tree47d429de151ae818ccd73fdbd0096c85e3a58cef
parent18507a4c76abad7cf5e6e9572137d0dc5a977fcc (diff)
downloadchd_gestion-eeb6aee61bc55a95a4d62d354f180d167c6a25fb.zip
chd_gestion-eeb6aee61bc55a95a4d62d354f180d167c6a25fb.tar.gz
chd_gestion-eeb6aee61bc55a95a4d62d354f180d167c6a25fb.tar.bz2
Adding debug tool, tweaking date formatting
-rw-r--r--app-from-scratch.sh6
-rw-r--r--fai_gestion/config/app.php1
-rw-r--r--fai_gestion/config/bootstrap.php7
3 files changed, 13 insertions, 1 deletions
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