Task #56200
closedClean up duplicated code in calcAge
0%
Description
both classes
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
implement calcAge() method, which is almost exact copy.
We should refactor it by moving the method to some utility class.
Updated by Wouter Wolters over 10 years ago
Tymek see https://review.typo3.org/#/c/24635/
Updated by Tymoteusz Motylewski over 10 years ago
Thanks Wouter, I missed this one.
This can be closed then, as it is a duplicate.
Updated by Bernhard Kraft over 10 years ago
- Status changed from Closed to New
The linked issue is in not really a solution for this problem. I rather addresses wrong age calculation. While this one addressed the code duplication.
I created a patch (review) which fixes the code duplication by also creating a "DateTimeUtility" class.
But no algorithms were changed. Only refactoring.
I guess if the review is merged the other patch changing the behaviour could get implemented easier.
Updated by Gerrit Code Review over 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28157
Updated by Bernhard Kraft over 10 years ago
- Status changed from Under Review to New
I posted the patch to gerrit.
Additionally I have a second refactoring patch which moves all date/time related methods from BackendUtility and GeneralUtility to DateTimeUtility
Updated by Gerrit Code Review over 10 years ago
- Status changed from New to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28157
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28157
Updated by Wouter Wolters over 9 years ago
- Status changed from Under Review to Closed
Duplicate of #20016