Feature #15162
closed
date-params are hardcoded
Added by Thomas Murphy about 19 years ago.
Updated about 6 years ago.
Description
class.tx_indexedsearch.php - function makeInfo()::line 1917
Date params are hardcoded, should be easy to put it into typoscript setup instead.
(issue imported from #M1740)
Files
Change the two lines for 'created' and 'modified' into:
$tmplArray['created'] = $this->pi_getLL('res_created','',1).' '.t3lib_BEfunc::date($row['item_crdate']);
$tmplArray['modified'] = $this->pi_getLL('res_modified','',1).' '.t3lib_BEfunc::datetime($row['item_mtime']);
Don't forget to include
require_once(PATH_t3lib.'class.t3lib_befunc.php');
hmm, it's really anyoing that this bug didn't make it into shipped version of typo3 4.0.
@Bjoern
your patch isn't really a good solution.
a) BE-funcs should stay where they belong to
b) the label shouldn't be prepended as it has it's own marker
Currently (TYPO3 4.1) they are affected by the system globals:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']
$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']
The format of these dates should configurable with TS.
The makeInfo() function could be changed like this:
// existing format definition
$dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
$timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
// insert the following two lines:
$createdFormat = ( $this->conf['dateFormat.']['created'] ) ? $this->conf['dateFormat.']['created'] : $dateFormat;
$modifiedFormat = ( $this->conf['dateFormat.']['modified'] ) ? $this->conf['dateFormat.']['modified'] : $dateFormat.' '.$timeFormat;
// modify these existing two lines of code:
$tmplArray['created'] = date($createdFormat, $row['item_crdate']);
$tmplArray['modified'] = date($modifiedFormat, $row['item_mtime']);
I checked the code, it is already fixed.
Resolving the issue was incorrect step. It is still actual.
Version 2 of the patch uses strftime() because strftime(0 supports locales.
- Status changed from Resolved to Closed
Also available in: Atom
PDF