Bug #49400
closed
Fix date format in BE user module - might be easier than it looks like
Added by Chris topher over 11 years ago.
Updated almost 11 years ago.
Category:
Backend User Interface
Description
The date format in the BE user module is not yet localized. Dates should use the format, which is set in $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].
This affects the dates in the tables
- "User list"
- "Active sessions" and
- "Compare Backend Users" (which you see after clicking the "Compare user list" button)
Dates are handled with one and the same variable at 5 places:
In Partials/BackendUser/IndexListRow.html
<f:format.date format="{dateFormat} {timeFormat}">{backendUser.lastLoginDateAndTime}</f:format.date>
In Partials/BackendUser/OnlineListRow.html with these lines:
<f:format.date format="{dateFormat} {timeFormat}">{session.timestamp}</f:format.date>
And in Templates\BackendUser\Compare.html
Line 85: <f:format.date format="{dateFormat} {timeFormat}">{compareUser.startDateAndTime}</f:format.date>
Line 100: <f:format.date format="{dateFormat} {timeFormat}">{compareUser.endDateAndTime}</f:format.date>
Line 115: <f:format.date format="{dateFormat} {timeFormat}">{compareUser.lastLoginDateAndTime}</f:format.date>
Proposed solution:
The variable {dateFormat}
should take the value from $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].
Files
- Category set to Backend User Interface
- Status changed from New to Accepted
- Complexity set to easy
This is already the case and is set in BackendUserController for each action.
125 $this->view->assign('dateFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']);
126 $this->view->assign('timeFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']);
146 $this->view->assign('dateFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']);
147 $this->view->assign('timeFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']);
159 $this->view->assign('dateFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']);
160 $this->view->assign('timeFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']);
The problem here is that with the format given in these variables don't have a % character in them. So the DateViewHelper doesn't use strftime function to make them localized.
Ohh guys, I am so sorry: For me the dates in fact are localized. (But when you use a new installation and don't set $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']
, then this does not work...) Shame on me. :-(
What is the problem you mean, Wouter?
When you e.g. set $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] = 'd.m.Y'; then you get the display from the attached screenshot. I would call that working. :-/
Or did you mean something else?
Hi Wouter,
Christopher wrote a question to you, so I added you to the watchers list of this issue.
- Status changed from Needs Feedback to Closed
- Is Regression set to No
Sorry for the late reply. I mixed things up here with the localization of the date format. This is the correct behaviour but as explained by Christopher the problem was on his side
Closing!
Also available in: Atom
PDF