Correctly format dates in future

release-0.6
thomascube 18 years ago
parent 568ba395b6
commit 87b280e94b

@ -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']); $week_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday']-6, $now_date['year']);
// define date format depending on current time // 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)); 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'; $format = $CONFIG['date_short'] ? $CONFIG['date_short'] : 'D H:i';
else if (!$format) else if (!$format)
$format = $CONFIG['date_long'] ? $CONFIG['date_long'] : 'd.m.Y H:i'; $format = $CONFIG['date_long'] ? $CONFIG['date_long'] : 'd.m.Y H:i';

Loading…
Cancel
Save