Revert "[TASK] Rebuild the calcAge functionality"
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / Classes / Controller / SearchController.php
index 85a8e82..27d6e0e 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
@@ -160,20 +159,20 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                $resultsets = array();
                foreach ($indexCfgs as $freeIndexUid) {
                        // Get result rows
-                       $tstamp1 = DateTimeUtility::milliseconds();
+                       $tstamp1 = GeneralUtility::milliseconds();
                        if ($hookObj = $this->hookRequest('getResultRows')) {
                                $resultData = $hookObj->getResultRows($this->searchWords, $freeIndexUid);
                        } else {
                                $resultData = $this->searchRepository->doSearch($this->searchWords, $freeIndexUid);
                        }
                        // Display search results
-                       $tstamp2 = DateTimeUtility::milliseconds();
+                       $tstamp2 = GeneralUtility::milliseconds();
                        if ($hookObj = $this->hookRequest('getDisplayResults')) {
                                $resultsets[$freeIndexUid] = $hookObj->getDisplayResults($this->searchWords, $resultData, $freeIndexUid);
                        } else {
                                $resultsets[$freeIndexUid] = $this->getDisplayResults($this->searchWords, $resultData, $freeIndexUid);
                        }
-                       $tstamp3 = DateTimeUtility::milliseconds();
+                       $tstamp3 = GeneralUtility::milliseconds();
                        // Create header if we are searching more than one indexing configuration
                        if (count($indexCfgs) > 1) {
                                if ($freeIndexUid > 0) {
@@ -467,15 +466,14 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                                return ceil(log($total) / log($max) * 100) . '%';
                                break;
                        case 'crdate':
-                               return DateTimeUtility::getSimpleAgeString($row['item_crdate']);
+                               return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_crdate'], 0);
                                break;
                        case 'mtime':
-                               return DateTimeUtility::getSimpleAgeString($row['item_mtime']);
+                               return $this->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_mtime'], 0);
                                break;
                        default:
                                return ' ';
                }
-               return '';
        }
 
        /**