date format for messages in last year
|Reported by:||mikelward||Owned by:|
Description (last modified by thomasb)
I really like being able to set different formats for messages from today and the last week. It would also be really cool if I could set a custom format for message from the last year.
For what it's worth, these are the settings I use:
date_today = ' '; date_short = 'l'; date_medium = 'j M'; date_long = 'M Y';
Today Monday 24 Feb Mar 2007
The obvious patch is:
$year_limit = mktime(0, 0, 0, $now_date['mon']-11, 0, $now_date['year']);
below $week_limit in include/main.inc (about line 1513)
else if ($CONFIG['prettydate'] && !$format && $timestamp > $year_limit && $timestamp < $now) $format = $CONFIG['date_medium'] ? $CONFIG['date_medium'] : 'd.m H:i';
below $format = $CONFIG['date_short']... (about line 1520)
Obviously this includes the time, as the other default formats do, but it omits the year, implying it occurred within the last 11 months. Anything from the same month last year would use the full date format.