Skip to content

Commit

Permalink
Merge pull request #28 from smartbooster/php_formatter
Browse files Browse the repository at this point in the history
Add PhpFormatter
  • Loading branch information
mathieu-ducrot authored May 6, 2024
2 parents 098ed9f + 403b51c commit 62326d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 17 additions & 0 deletions src/Formatter/PhpFormatter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Smart\CoreBundle\Formatter;

/**
* @author Mathieu Ducrot <[email protected]>
*/
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';
}

0 comments on commit 62326d0

Please sign in to comment.