summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--config/main.inc.php.dist6
-rw-r--r--program/include/main.inc3
3 files changed, 7 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 869651f86..b98c2b227 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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()