Ticket #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) (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
Change History
Note: See
TracTickets for help on using
tickets.
