summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-03-14 08:50:34 +0000
committerthomascube <thomas@roundcube.net>2007-03-14 08:50:34 +0000
commit87b280e94be4d4389ef660ab60d0484361599d35 (patch)
tree7c527f39184c3e1d2899f221292f98758523dbef /program
parent568ba395b6ca0a5779600a435a9906ae88de6d5f (diff)
Correctly format dates in future
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index b19c7f412..68cc9032c 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1726,9 +1726,9 @@ function format_date($date, $format=NULL)
$week_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday']-6, $now_date['year']);
// define date format depending on current time
- if ($CONFIG['prettydate'] && !$format && $timestamp > $today_limit)
+ if ($CONFIG['prettydate'] && !$format && $timestamp > $today_limit && $timestamp < $now)
return sprintf('%s %s', rcube_label('today'), date($CONFIG['date_today'] ? $CONFIG['date_today'] : 'H:i', $timestamp));
- else if ($CONFIG['prettydate'] && !$format && $timestamp > $week_limit)
+ else if ($CONFIG['prettydate'] && !$format && $timestamp > $week_limit && $timestamp < $now)
$format = $CONFIG['date_short'] ? $CONFIG['date_short'] : 'D H:i';
else if (!$format)
$format = $CONFIG['date_long'] ? $CONFIG['date_long'] : 'd.m.Y H:i';