FEATURE: Extends Eel DateHelper with machine-readable formats#1301
FEATURE: Extends Eel DateHelper with machine-readable formats#1301putzwasser wants to merge 1 commit intoneos:masterfrom
Conversation
Adds methods which format a DateTime into machine-readable formats to use it e.g. in the `datetime` attribute of a `<time>` tag. * htmlDateTime formats a DateTime into the W3C format "Y-m-d\TH:i:sP" * htmlDate formats the date part of a DateTime into "Y-m-D" * htmlTime formats the time part of a DateTime into "H:i:sP"
| */ | ||
| public function htmlDateTime(\DateTimeInterface $dateTime) | ||
| { | ||
| return $dateTime->format(\DateTime::W3C); |
There was a problem hiding this comment.
Is there a particular reason why you chose the \DateTime:W3C format?
I know that we use this as default in the DateTimeConverter but this was a mistake IMO because it lacks some crucial features.
|
@putzwasser Thanks a lot and congratulations to your first Pull Request! (untested) |
|
Thanks for your comment. |
albe
left a comment
There was a problem hiding this comment.
Looking at the possible formats for the time tag, I'm a bit unsure about how useful it is to add specialized helpers for three formats. Why not also add one for year, month, time without fraction/seconds and local datetime? Those are all equally valid and probable use cases. I'd rather not increase API surface needlessly.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! |
|
This issue has been automatically closed because it has not had activity for some time. But that does not need to be final. If you find the time to work on it, feel free to open it again. Thanks again for your contributions! |
Adds methods which format a DateTime into machine-readable formats to use it e.g. in the
datetimeattribute of a<time>tag.