[TASK] Rebuild the calcAge functionality 35/24635/20
authorAlexander Opitz <opitz.alexander@googlemail.com>
Sat, 12 Oct 2013 14:36:25 +0000 (16:36 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Sun, 29 Jun 2014 15:51:56 +0000 (17:51 +0200)
commit98c0ff7144a67ce8780a1b1ebe55749b6909e202
tree393f2a8e16135bc55ed625903a92f5d02be90d37
parent1a87798b66e31112aab0d99b413ef1c8bacc0372
[TASK] Rebuild the calcAge functionality

We have two calcAge functions with same functionality and same issues.
So this is moved to a new DateTimeUtility class and deprecated in the
the original classes. Also time functions from GeneralUtility are moved
to the new class.

Following issues are resolved:
* Age calculation does not respect leap years.
* Age calculation may round up so something seams older than it is.
* Between days and years there are months missing, so we get now 2 months
  instead of 60 days.

Resolves: #20016
Releases: 6.3, 6.2
Change-Id: Ie323f30b1fb97b68f89d43605ccda67f219a965a
Reviewed-on: https://review.typo3.org/24635
Reviewed-by: Markus Klein
Tested-by: Markus Klein
25 files changed:
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/Wizard/RteController.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Classes/History/RecordHistory.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/Classes/Utility/DateTimeUtility.php [new file with mode: 0644]
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Tests/Unit/Utility/DateTimeUtilityTest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Utility/Fixtures/DateTimeUtilityFixture.php [new file with mode: 0644]
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Controller/PageInformationController.php
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
typo3/sysext/indexed_search/Classes/Indexer.php
typo3/sysext/install/Classes/Controller/Action/Tool/TestSetup.php
typo3/sysext/lang/locallang_core.xlf
typo3/sysext/lowlevel/Classes/CleanerCommand.php
typo3/sysext/lowlevel/Classes/OrphanRecordsCommand.php