Ticket #1484843: year-date.patch

File year-date.patch, 1.1 kB (added by mikelward, 9 months ago)

proper patch - a simple change to main.inc.php.dist would also be a good idea

  • main.inc

    old new  
    15111511 
    15121512  $today_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday'], $now_date['year']); 
    15131513  $week_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday']-6, $now_date['year']); 
     1514  $year_limit = mktime(0, 0, 0, $now_date['mon']-11, 0, $now_date['year']); 
    15141515 
    15151516  // define date format depending on current time   
    15161517  if ($CONFIG['prettydate'] && !$format && $timestamp > $today_limit && $timestamp < $now) 
    15171518    return sprintf('%s %s', rcube_label('today'), date($CONFIG['date_today'] ? $CONFIG['date_today'] : 'H:i', $timestamp)); 
    15181519  else if ($CONFIG['prettydate'] && !$format && $timestamp > $week_limit && $timestamp < $now) 
    15191520    $format = $CONFIG['date_short'] ? $CONFIG['date_short'] : 'D H:i'; 
     1521  else if ($CONFIG['prettydate'] && !$format && $timestamp > $year_limit && $timestamp < $now) 
     1522    $format = $CONFIG['date_medium'] ? $CONFIG['date_medium'] : 'd.m H:i'; 
    15201523  else if (!$format) 
    15211524    $format = $CONFIG['date_long'] ? $CONFIG['date_long'] : 'd.m.Y H:i'; 
    15221525