[TASK] Rebuild the calcAge functionality 31/31231/2
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:52:20 +0000 (17:52 +0200)
commit4c52cb3cfe4f6819a29f1daa064859affe23989d
tree27f24a410fee56f156b2d2c099ec063941135a07
parent3dd47a8baf2f20508210d5721c3ace632858db02
[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/31231
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