summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-02-17 09:12:22 +0000
committeralecpl <alec@alec.pl>2011-02-17 09:12:22 +0000
commitc5dedd79caa2b083b264ce0af16cd54e968b817c (patch)
tree3013a073210e7f038a126a6741d1ff57c2fe8fa3
parent31036bb3eb65f9b6513631a71936fe19f302815c (diff)
- Add variable for 'Today' label in date_today option (#1486120)
-rw-r--r--CHANGELOG1
-rw-r--r--config/main.inc.php.dist1
-rw-r--r--program/include/main.inc13
3 files changed, 14 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 557d7ab88..85f2bc3e9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Add variable for 'Today' label in date_today option (#1486120)
- Fix dont_override setting does not override existing user preferences (#1487664)
- Use only one from IMAP authentication methods to prevent login delays (1487784)
- Replying to a sent message puts the old recipient as the new recipient (#1487074)
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index 36c52775a..3d9cd0663 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -352,6 +352,7 @@ $rcmail_config['date_short'] = 'D H:i';
$rcmail_config['date_long'] = 'd.m.Y H:i';
// use this format for today's date display (date or strftime format)
+// Note: $ character will be replaced with 'Today' label
$rcmail_config['date_today'] = 'H:i';
// use this format for date display without time (date or strftime format)
diff --git a/program/include/main.inc b/program/include/main.inc
index 568b3349d..f2923c52e 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1118,7 +1118,18 @@ function format_date($date, $format=NULL)
$out .= date($format{$i}, $timestamp);
}
- return $today ? (rcube_label('today') . ' ' . $out) : $out;
+ if ($today) {
+ $label = rcube_label('today');
+ // replcae $ character with "Today" label (#1486120)
+ if (strpos($out, '$') !== false) {
+ $out = preg_replace('/\$/', $label, $out, 1);
+ }
+ else {
+ $out = $label . ' ' . $out;
+ }
+ }
+
+ return $out;
}