Revert "[TASK] Rebuild the calcAge functionality"
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / Classes / Controller / SearchFormController.php
index 1ff310c..69d01fc 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\IndexedSearch\Controller;
  */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\DateTimeUtility;
 
 /**
  * Index search frontend
@@ -492,20 +491,20 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                $accumulatedContent = '';
                foreach ($indexCfgs as $freeIndexUid) {
                        // Get result rows:
-                       $pt1 = DateTimeUtility::milliseconds();
+                       $pt1 = GeneralUtility::milliseconds();
                        if ($hookObj = $this->hookRequest('getResultRows')) {
                                $resData = $hookObj->getResultRows($sWArr, $freeIndexUid);
                        } else {
                                $resData = $this->getResultRows($sWArr, $freeIndexUid);
                        }
                        // Display search results:
-                       $pt2 = DateTimeUtility::milliseconds();
+                       $pt2 = GeneralUtility::milliseconds();
                        if ($hookObj = $this->hookRequest('getDisplayResults')) {
                                $content = $hookObj->getDisplayResults($sWArr, $resData, $freeIndexUid);
                        } else {
                                $content = $this->getDisplayResults($sWArr, $resData, $freeIndexUid);
                        }
-                       $pt3 = DateTimeUtility::milliseconds();
+                       $pt3 = GeneralUtility::milliseconds();
                        // Create header if we are searching more than one indexing configuration:
                        if (count($indexCfgs) > 1) {
                                if ($freeIndexUid > 0) {
@@ -1873,17 +1872,16 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                break;
                        case 'crdate':
                                // Based on creation date
-                               return DateTimeUtility::getSimpleAgeString($row['item_crdate']);
+                               return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_crdate'], 0);
                                break;
                        case 'mtime':
                                // Based on modification time
-                               return DateTimeUtility::getSimpleAgeString($row['item_mtime']);
+                               return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_mtime'], 0);
                                break;
                        default:
                                // fx. title
                                return ' ';
                }
-               return '';
        }
 
        /**