name of the last user to edit the page
* LinkerMakeExternalLink now has an $attribs parameter for link attributes and
a $linkType parameter for the type of external link being made
+* (bug 17785) Dynamic dates surrounded with a <span> tag, fixing sortable tables with
+ dynamic dates.
=== Bug fixes in 1.15 ===
* (bug 16968) Special:Upload no longer throws useless warnings.
$bits[$key{$p}] = $matches[$p+1];
}
}
-
+
+ return $this->formatDate( $bits );
+ }
+
+ function formatDate( $bits ) {
$format = $this->targets[$this->mTarget];
# Construct new date
$text = '';
$fail = false;
+
+ // Pre-generate y/Y stuff because we need the year for the <span> title.
+ if ( !isset( $bits['y'] ) )
+ $bits['y'] = $this->makeIsoYear( $bits['Y'] );
+ if ( !isset( $bits['Y'] ) )
+ $bits['Y'] = $this->makeNormalYear( $bits['y'] );
for ( $p=0; $p < strlen( $format ); $p++ ) {
$char = $format{$p};
}
break;
case 'y': # ISO year
- if ( !isset( $bits['y'] ) ) {
- $text .= $this->makeIsoYear( $bits['Y'] );
- } else {
- $text .= $bits['y'];
- }
+ $text .= $bits['y'];
break;
case 'j': # ordinary day of month
if ( !isset($bits['j']) ) {
}
break;
case 'Y': # ordinary (optional BC) year
- if ( !isset( $bits['Y'] ) ) {
- $text .= $this->makeNormalYear( $bits['y'] );
- } else {
- $text .= $bits['Y'];
- }
+ $text .= $bits['Y'];
break;
default:
$text .= $char;
if ( $fail ) {
$text = $matches[0];
}
+
+ $isoDate = $bits['y'].$bits['m'].$bits['d'];
+
+ // Output is not strictly HTML (it's wikitext), but <span> is whitelisted.
+ $text = Xml::tags( 'span',
+ array( 'class' => 'mw-formatted-date', 'title' => $isoDate ), $text );
+
return $text;
}