feat: timestamp getters for PostObjectInterface #1283
Merged
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 several changes across multiple files, primarily focusing on adding and testing date handling functionality and enhancing post object decorators. The most important changes include the addition of a method to format dates to Unix timestamps, updates to post object decorators to include published and modified times, and corresponding tests for these functionalities.
Date Handling Enhancements:
library/Controller/Archive.php
: AddedtryFormatDateToUnixTimestamp
method to format dates to Unix timestamps and integrated it into thegetDate
method. [1] [2]library/Controller/Archive.test.php
: Added tests fortryFormatDateToUnixTimestamp
to ensure it correctly formats valid date strings and returns null for invalid date strings.Post Object Decorators Enhancements:
library/PostObject/Decorators/BackwardsCompatiblePostObject.php
,library/PostObject/Decorators/IconResolvingPostObject.php
,library/PostObject/Decorators/PostObjectFromOtherBlog.php
,library/PostObject/Decorators/PostObjectFromWpPost.php
,library/PostObject/Decorators/PostObjectWithSeoRedirect.php
: AddedgetPublishedTime
andgetModifiedTime
methods to various post object decorators. [1] [2] [3] [4] [5]Post Object Interface and Implementation:
library/PostObject/PostObject.php
,library/PostObject/PostObjectInterface.php
: AddedgetPublishedTime
andgetModifiedTime
methods to the post object interface and its implementation. [1] [2]Blade Template Updates:
views/v3/partials/post/post-compressed.blade.php
: Updated to usegetPublishedTime
andgetModifiedTime
methods for displaying post dates. [1] [2]