Task #56200
closed
Clean up duplicated code in calcAge
Added by Tymoteusz Motylewski over 10 years ago.
Updated over 9 years ago.
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.
Thanks Wouter, I missed this one.
This can be closed then, as it is a duplicate.
- Status changed from New to Closed
- 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.
- Status changed from New to Under Review
- 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
- Status changed from New to Under Review
- Status changed from Under Review to Closed
Also available in: Atom
PDF