r51628 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51627‎ | r51628 | r51629 >
Date:01:56, 9 June 2009
Author:soxred93
Status:deferred (Comments)
Tags:
Comment:
Add B and S options to #time:
Modified paths:
  • /trunk/extensions/ParserFunctions/SprintfDateCompat.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/SprintfDateCompat.php
@@ -141,6 +141,15 @@
142142 if ( !$unix ) $unix = wfTimestamp( TS_UNIX, $ts );
143143 $num = $unix;
144144 break;
 145+ case 'B':
 146+ if ( !$unix ) $unix = wfTimestamp( TS_UNIX, $ts );
 147+ $num = date( 'B', $unix );
 148+ break;
 149+ case 'S':
 150+ if ( !$unix ) $unix = wfTimestamp( TS_UNIX, $ts );
 151+ $num = date( 'S', $unix );
 152+ break;
 153+
145154 case '\\':
146155 # Backslash escaping
147156 if ( $p < strlen( $format ) - 1 ) {

Comments

#Comment by Nikerabbit (talk | contribs)   18:17, 11 June 2009

I would have liked to know what B and S does. Shouldn't the core have same set of characters?

S  	English ordinal suffix for the day of the month, 2 characters
B  	Swatch Internet time

Shouldn't S be localisable? IRCC there was a bug report for something similar in French.

#Comment by X! (talk | contribs)   00:35, 12 June 2009

It's what PHP's date() functions uses, which is what the other time cases are as well.

#Comment by Tim Starling (talk | contribs)   03:20, 15 June 2009

Why are you bothering to change a file which is only used in MediaWiki 1.7 and earlier?

#Comment by X! (talk | contribs)   04:23, 15 June 2009

You know, that's a very good question. :) I guess I misread the _body file...

Status & tagging log