Index: typo3/sysext/indexed_search/ext_typoscript_setup.txt =================================================================== --- typo3/sysext/indexed_search/ext_typoscript_setup.txt (revision 7131) +++ typo3/sysext/indexed_search/ext_typoscript_setup.txt (working copy) @@ -5,6 +5,12 @@ plugin.tx_indexedsearch { templateFile = EXT:indexed_search/pi/indexed_search.tmpl + # Date formats for created/modified dates in search results. See PHP strftime() function. Leave blank for using system defaults + dateFormat { + created = + modified = + } + show { rules = 1 parsetimes = 0 Index: typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php =================================================================== --- typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (revision 7135) +++ typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (working copy) @@ -2096,12 +2096,9 @@ * @return array Modified template array */ function makeInfo($row,$tmplArray) { - $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']; - $timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; - $tmplArray['size'] = t3lib_div::formatSize($row['item_size']); - $tmplArray['created'] = date($dateFormat, $row['item_crdate']); - $tmplArray['modified'] = date($dateFormat.' '.$timeFormat, $row['item_mtime']); + $tmplArray['created'] = $this->formatCreatedDate($row['item_crdate']); + $tmplArray['modified'] = $this->formatModifiedDate($row['item_mtime']); $pathId = $row['data_page_id']?$row['data_page_id']:$row['page_id']; $pathMP = $row['data_page_id']?$row['data_page_mp']:''; @@ -2395,6 +2392,51 @@ } } } + + /** + * Formats date as 'created' date + * + * @param int $date + * @param string $defaultFormat + * @return string + */ + protected function formatCreatedDate($date) { + $defaultFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']; + return $this->formatDate($date, 'created', $defaultFormat); + } + + /** + * Formats date as 'modified' date + * + * @param int $date + * @param string $defaultFormat + * @return string + */ + protected function formatModifiedDate($date) { + $defaultFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . + $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; + return $this->formatDate($date, 'modified', $defaultFormat); + } + + /** + * Formats the date using format string from TypoScript or default format + * if TypoScript format is not set + * + * @param int $date + * @param string $tsKey + * @param string $defaultFormat + * @return string + */ + protected function formatDate($date, $tsKey, $defaultFormat) { + $strftimeFormat = $this->conf['dateFormat.'][$tsKey]; + if ($strftimeFormat) { + $result = strftime($strftimeFormat, $date); + } + else { + $result = date($defaultFormat, $date); + } + return $result; + } }