diff options
author | alecpl <alec@alec.pl> | 2009-07-07 09:11:21 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-07-07 09:11:21 +0000 |
commit | b6b593416bb1bef12c30b0cea8c92221d4b7a5c2 (patch) | |
tree | 5b3a9968a3f04d31f9d15d55ea440e6b06902447 | |
parent | 72cd3c1a761fad73235cad32f240a114ba2941aa (diff) |
- Support strftime's format modifiers in date_* options (#1484806)
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | config/main.inc.php.dist | 6 | ||||
-rw-r--r-- | program/include/main.inc | 3 |
3 files changed, 7 insertions, 3 deletions
@@ -1,6 +1,7 @@ CHANGELOG RoundCube Webmail =========================== +- Support strftime's format modifiers in date_* options (#1484806) - Support %h variable in 'smtp_server' option (#1485766) - Show SMTP errors in browser (#1485927) - Allow WBR tag in HTML message (#1485960) diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist index b456db935..d77372099 100644 --- a/config/main.inc.php.dist +++ b/config/main.inc.php.dist @@ -155,13 +155,13 @@ $rcmail_config['des_key'] = 'rcmail-!24ByteDESkey*Str'; // RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR $rcmail_config['language'] = null; -// use this format for short date display +// use this format for short date display (date or strftime format) $rcmail_config['date_short'] = 'D H:i'; -// use this format for detailed date/time formatting +// use this format for detailed date/time formatting (date or strftime format) $rcmail_config['date_long'] = 'd.m.Y H:i'; -// use this format for today's date display +// use this format for today's date display (date or strftime format) $rcmail_config['date_today'] = 'H:i'; // add this user-agent to message headers when sending diff --git a/program/include/main.inc b/program/include/main.inc index 5ff5f499b..d8b832844 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -893,6 +893,9 @@ function format_date($date, $format=NULL) else if (!$format) $format = $CONFIG['date_long'] ? $CONFIG['date_long'] : 'd.m.Y H:i'; + // strftime() format + if (preg_match('/%[a-z]+/i', $format)) + return strftime($format, $timestamp); // parse format string manually in order to provide localized weekday and month names // an alternative would be to convert the date() format string to fit with strftime() |