* added {{CURRENTMONTH2}} and {{LOCALMONTH2}} as alias of {{CURRENTMONTH}} and {{LOCALMONTH}} for consistency with other magic words
* Database: unionQueries function to be used for UNION sql construction, so
it can be overloaded on DB abstraction level for DB specific functionality
* (bug 18849) Implement Japanese and North Korean calendars
+* (bug 5755) Introduce {{CURRENTMONTH1}} and {{LOCALMONTH1}} to display the
+ month number without the leading zero
=== Bug fixes in 1.16 ===
static public $mVariableIDsInitialised = false;
static public $mVariableIDs = array(
'currentmonth',
+ 'currentmonth1',
'currentmonthname',
'currentmonthnamegen',
'currentmonthabbrev',
'currenttime',
'currenthour',
'localmonth',
+ 'localmonth1',
'localmonthname',
'localmonthnamegen',
'localmonthabbrev',
/* Array of caching hints for ParserCache */
static public $mCacheTTLs = array (
'currentmonth' => 86400,
+ 'currentmonth1' => 86400,
'currentmonthname' => 86400,
'currentmonthnamegen' => 86400,
'currentmonthabbrev' => 86400,
'currenttime' => 3600,
'currenthour' => 3600,
'localmonth' => 86400,
+ 'localmonth1' => 86400,
'localmonthname' => 86400,
'localmonthnamegen' => 86400,
'localmonthabbrev' => 86400,
wfSuppressWarnings(); // E_STRICT system time bitching
$localTimestamp = date( 'YmdHis', $ts );
$localMonth = date( 'm', $ts );
+ $localMonth1 = date( 'n', $ts );
$localMonthName = date( 'n', $ts );
$localDay = date( 'j', $ts );
$localDay2 = date( 'd', $ts );
switch ( $index ) {
case 'currentmonth':
return $this->mVarCache[$index] = $wgContLang->formatNum( gmdate( 'm', $ts ) );
+ case 'currentmonth1':
+ return $this->mVarCache[$index] = $wgContLang->formatNum( gmdate( 'n', $ts ) );
case 'currentmonthname':
return $this->mVarCache[$index] = $wgContLang->getMonthName( gmdate( 'n', $ts ) );
case 'currentmonthnamegen':
return $this->mVarCache[$index] = $wgContLang->formatNum( gmdate( 'd', $ts ) );
case 'localmonth':
return $this->mVarCache[$index] = $wgContLang->formatNum( $localMonth );
+ case 'localmonth1':
+ return $this->mVarCache[$index] = $wgContLang->formatNum( $localMonth1 );
case 'localmonthname':
return $this->mVarCache[$index] = $wgContLang->getMonthName( $localMonthName );
case 'localmonthnamegen':
'toc' => array( 0, '__TOC__' ),
'noeditsection' => array( 0, '__NOEDITSECTION__' ),
'noheader' => array( 0, '__NOHEADER__' ),
- 'currentmonth' => array( 1, 'CURRENTMONTH' ),
+ 'currentmonth' => array( 1, 'CURRENTMONTH', 'CURRENTMONTH2' ),
+ 'currentmonth1' => array( 1, 'CURRENTMONTH1' ),
'currentmonthname' => array( 1, 'CURRENTMONTHNAME' ),
'currentmonthnamegen' => array( 1, 'CURRENTMONTHNAMEGEN' ),
'currentmonthabbrev' => array( 1, 'CURRENTMONTHABBREV' ),
'currentyear' => array( 1, 'CURRENTYEAR' ),
'currenttime' => array( 1, 'CURRENTTIME' ),
'currenthour' => array( 1, 'CURRENTHOUR' ),
- 'localmonth' => array( 1, 'LOCALMONTH' ),
+ 'localmonth' => array( 1, 'LOCALMONTH', 'LOCALMONTH2' ),
+ 'localmonth1' => array( 1, 'LOCALMONTH1' ),
'localmonthname' => array( 1, 'LOCALMONTHNAME' ),
'localmonthnamegen' => array( 1, 'LOCALMONTHNAMEGEN' ),
'localmonthabbrev' => array( 1, 'LOCALMONTHABBREV' ),