Ticket #1484843 (new Feature Requests)

Opened 7 months ago

Last modified 4 months ago

date format for messages in last year

Reported by: mikelward Owned by:
Priority: 5 Milestone: later
Component: Client Scripts Version: 0.1-stable
Severity: minor Keywords:
Cc:

Description (last modified by thomasb) (diff)

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';

which gives

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)

and:

  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.

Attachments

year-date.patch (1.1 kB) - added by mikelward 7 months ago.
proper patch - a simple change to main.inc.php.dist would also be a good idea

Change History

Changed 7 months ago by mikelward

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

Changed 7 months ago by thomasb

  • severity changed from normal to minor
  • description modified (diff)
  • milestone changed from 0.1.1 to later

(better wiki formatting)

Changed 4 months ago by alec

-1 from me

Note: See TracTickets for help on using tickets.