Last modified: 2010-05-15 15:28:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 1206 - Adding two new time variables for templates, useful for Main_Page sections automation
Adding two new time variables for templates, useful for Main_Page sections au...
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Antoine "hashar" Musso (WMF)
: patch
: 1215 (view as bug list)
Depends on:
Blocks: 4383
  Show dependency treegraph
Reported: 2004-12-26 23:49 UTC by M7
Modified: 2010-05-15 15:28 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description M7 2004-12-26 23:49:15 UTC
I propose to change three files in order to add two more time variables to
mediawiki environment.

See proposed changes:

mario@castrum /usr/local/mediawiki/includes$ diff MagicWord.php MagicWord.orig
< define("MAG_CURRENTWEEK", 35);
< define("MAG_CURRENTDOW", 36);

mario@castrum /usr/local/mediawiki/includes$ diff Parser.php Parser.orig
<                       case MAG_CURRENTDOW:
<                               return $wgLang->formatNum( date( 'w' ) );
<                       case MAG_CURRENTWEEK:
<                               return $wgLang->formatNum( date( 'W' ) );

mario@castrum /usr/local/mediawiki/languages$ diff Language.php Language.orig
<     MAG_CURRENTWEEK          => array( 1,    'CURRENTWEEK'            ),
<     MAG_CURRENTDOW           => array( 1,    'CURRENTDOW'             ),

You can see a working test page at

Comment 1 Ævar Arnfjörð Bjarmason 2004-12-27 01:45:06 UTC
One thing that would have to be changeable and translatable is when the week
starts, according to ISO 8601 the week begins on monday (day 1) and ends on
sunday (day 7) while according to most others the week stats on sunday
(difference between the buisness week and the gregorian week perhaps)

Furthermore to increase complexity some count from 0 with monday (or sunday)
being the first day and sunday (or monday) being the sixth day.

See: and GNU date(1)
Comment 2 Zigger 2004-12-28 00:33:55 UTC
*** Bug 1215 has been marked as a duplicate of this bug. ***
Comment 3 Antoine "hashar" Musso (WMF) 2005-01-07 06:02:24 UTC
Will have a look at it in the next days probably.
Comment 4 IlyaHaykinson 2005-01-07 07:36:15 UTC
I increased the priority of this bug to Normal, unless there are objections. We
at Wikinews would really like this implemented. I suggest keeping the
implementation as ISO 8601 (which is what the date() function will do) and not
transforming the count per-culture.
Comment 5 Antoine "hashar" Musso (WMF) 2005-01-11 01:38:00 UTC
Commited in 1_4 and HEAD.
Will be part of beta5, probably going to be put on live
wikimedia sites soon.

Note You need to log in before you can comment on or make changes to this bug.