Page MenuHomePhabricator

Extend magic words - CURRENTWEEK
Closed, ResolvedPublic

Description

Author: saewyc

Description:
The use of an ISO week of the year variable is useful for lower-traffic sites
for elements such as a weekly featured article or collaboration of the week. The
range is 1-54 (ISO weeks begin on Monday, so most years have 53 weeks)

The magic word has been successfully implemented on SailWiki and involves the
following changes:

includes/magicwords.php - add MAG_CURRENTWEEK
includes/parser.php - add to getVariableValue:

case MAG_CURRENTWEEK:
  return $varCache[$index] = $wgContLang->formatNum( date('W') );

languages/language.php - add to $wgMagicWordsEn array:

MAG_CURRENTWEEK          => array( 1,    'CURRENTWEEK'            ),

Version: unspecified
Severity: enhancement
URL: http://wiki.saewyc.net

Details

Reference
bz1215

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:06 PM
bzimport set Reference to bz1215.
bzimport added a subscriber: Unknown Object (MLST).

zigger wrote:

*** This bug has been marked as a duplicate of 1206 ***

Diffusion added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:21 AM