r45066 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45065‎ | r45066 | r45067 >
Date:06:02, 27 December 2008
Author:david
Status:ok
Tags:
Comment:
Better date formats in archive browser. Fixes 15138. Archive browser is still a crock that we need to replace.
Modified paths:
  • /trunk/extensions/LiquidThreads/Lqt.i18n.php (modified) (history)
  • /trunk/extensions/LiquidThreads/LqtPages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/Lqt.i18n.php
@@ -17,6 +17,8 @@
1818 'lqt_newmessages' => 'New messages',
1919 'lqt_movethread' => 'Move thread to another page',
2020 'lqt_deletethread' => 'Delete or undelete thread',
 21+ 'lqt_archive_month_annotation' => "from $1",
 22+ 'lqt_archive_month_range_annotation' => 'between $1 and $2',
2123 'lqt_browse_archive_without_recent' => 'View archived threads',
2224 'lqt_browse_archive_with_recent' => 'older',
2325 'lqt_recently_archived' => 'Recently archived:',
Index: trunk/extensions/LiquidThreads/LqtPages.php
@@ -298,7 +298,14 @@
299299
300300 $this->datespan = $this->starti - $this->endi;
301301
302 - $annotations[] = "from {$this->selstart->text()} to {$this->selend->text()}";
 302+ $formattedFrom = $this->formattedMonth($this->selstart->text());
 303+ $formattedTo = $this->formattedMonth($this->selend->text());
 304+
 305+ if( $this->datespan == 0 ) {
 306+ $annotations[] = wfMsg('lqt_archive_month_annotation', $formattedFrom);
 307+ } else {
 308+ $annotations[] = wfMsg('lqt_archive_month_range_annotation', $formattedFrom, $formattedTo);
 309+ }
303310 } else if (isset($this->selstart)) {
304311 $annotations[] = "after {$this->selstart->text()}";
305312 } else if (isset($this->selend)) {

Status & tagging log