Ticket #1484806 (new Patches)
New option to allow strftime to format dates
| Reported by: | rjhughes | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | later |
| Component: | User Interface | Version: | 0.1-rc2 |
| Severity: | normal | Keywords: | strftime date format |
| Cc: |
Description (last modified by thomasb) (diff)
Hi. On my system (debian etch), I had the following in my config: $rcmail_config['date_long'] = 'D, M. j g:ia';
This resulted in the months being rendered like: "[feb]". I found that highly strange because I'd never seen that style of formatting. I was expecting "Feb".
From what I read in program/includes/main.inc, the problem seems to be that the php date() function doesn't provide localizations, so Roundcube is doing its own localization. But these localizations are different from the expected system ones. The comment suggested using strftime() instead, which does follow the system's rules.
Therefore, I created a new option for the config: $rcmail_config['date_format_style'] = 'strftime' or 'date' (default: 'date').
If it's set to 'date', then we'll use the current algorithm. If it's 'strftime', then we'll treat the strings like date_long and date_short as being in strftime format, and use that rather than the custom localizations.
I have a patch.
