Opened 5 years ago

Last modified 4 years ago

#1484843 new Feature Requests

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)

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 (2)

year-date.patch (1.1 KB) - added by mikelward 5 years ago.
proper patch - a simple change to main.inc.php.dist would also be a good idea
date_medium.diff (1.1 KB) - added by mikelward 4 years ago.
patch re-spun against 0.3RC1

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by mikelward

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

comment:1 Changed 5 years ago by thomasb

  • Description modified (diff)
  • Milestone changed from 0.1.1 to later
  • Severity changed from normal to minor

(better wiki formatting)

comment:2 Changed 5 years ago by alec

-1 from me

comment:3 Changed 4 years ago by mikelward

Why don't you like it Alec?

Any other thoughts? IMHO the change is trivial and useful.

Changed 4 years ago by mikelward

patch re-spun against 0.3RC1

Note: See TracTickets for help on using tickets.