From 403b51cd7c3d9a315cf087a691413fc65b600f2a Mon Sep 17 00:00:00 2001 From: Mathieu Ducrot Date: Mon, 6 May 2024 12:20:56 +0200 Subject: [PATCH] =?UTF-8?q?CU-86945nrx1=20Fix=20import=20num=C3=A9ro=20de?= =?UTF-8?q?=20s=C3=A9rie=20avec=20slash=20autoris=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ src/Formatter/PhpFormatter.php | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/Formatter/PhpFormatter.php diff --git a/CHANGELOG.md b/CHANGELOG.md index f3ea251..13d0378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ CHANGELOG for 1.x =================== +## v1.4.0 - (2024-05-06) +- `PhpFormatter` common date formatting to use on DateTime::format https://www.php.net/manual/en/datetime.format.php + ## v1.3.0 - (2024-04-29) ### Added - `ISO8601Formatter` for common date formatting diff --git a/src/Formatter/PhpFormatter.php b/src/Formatter/PhpFormatter.php new file mode 100644 index 0000000..eb36857 --- /dev/null +++ b/src/Formatter/PhpFormatter.php @@ -0,0 +1,17 @@ + + */ +class PhpFormatter +{ + // MDT Native php format to use on DateTime::format https://www.php.net/manual/en/datetime.format.php + public const DATE = 'Y-m-d'; + public const DATE_FR = 'd/m/Y'; + public const DATETIME = 'Y-m-d H:i'; + public const DATETIME_FR = 'd/m/Y H:i'; + public const DATETIME_WITH_SECONDS = 'Y-m-d H:i:s'; + public const DATETIME_WITH_SECONDS_FR = 'd/m/Y H:i:s'; +}