feat: allow unix timestamp in Date and DateBadge components #507
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes multiple changes to enhance the functionality and testing of date handling components. The changes involve updates to
composer.json
,phpunit.xml
, and several PHP classes and test files. The most important changes are listed below:Improvements to Testing and Configuration:
composer.json
: Modified thetest
script to include--testdox
and a configuration file for PHPUnit.phpunit.xml
: Updated to convert various types of PHP errors to exceptions and added a new directory suffix for test files. [1] [2]Enhancements to Date Handling:
source/php/Component/Date/Date.php
: Simplified date parsing by removing region and timezone settings, and added handling for both integer and string timestamps. [1] [2] [3]source/php/Component/Datebadge/Datebadge.php
: Updated to handle both string and integer date formats.Addition of Unit Tests:
source/php/Component/Date/Date.test.php
: Added comprehensive unit tests for theDate
class to ensure correct handling of various date formats and actions.source/php/Component/Datebadge/Datebadge.test.php
: Added unit tests for theDatebadge
class to verify date parsing and formatting.JSON Schema Updates:
source/php/Component/Date/date.json
: Updated the description and types for thetimestamp
field to accept both string and integer formats. [1] [2]source/php/Component/Datebadge/datebadge.json
: Updated the description and types for thedate
field to accept both string and integer formats.