Project

General

Profile

Actions

Task #56200

closed

Clean up duplicated code in calcAge

Added by Tymoteusz Motylewski about 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-02-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Sprint Focus:

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.


Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Task #20016: wrong age calculating in stdWrapNewAlexander Opitz2009-02-13

Actions
Precedes TYPO3 Core - Task #56651: Move date/time utility methods to own classClosed2014-03-07

Actions
Actions #2

Updated by Tymoteusz Motylewski about 10 years ago

Thanks Wouter, I missed this one.
This can be closed then, as it is a duplicate.

Actions #3

Updated by Wouter Wolters about 10 years ago

  • Status changed from New to Closed
Actions #4

Updated by Bernhard Kraft about 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.

Actions #5

Updated by Gerrit Code Review about 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

Actions #6

Updated by Bernhard Kraft about 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

Actions #7

Updated by Gerrit Code Review about 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

Actions #8

Updated by Gerrit Code Review about 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

Actions #9

Updated by Wouter Wolters over 9 years ago

  • Status changed from Under Review to Closed

Duplicate of #20016

Actions

Also available in: Atom PDF