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...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
1.3.x
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: ---


Attachments

Description M7 2004-12-26 23:49:15 UTC
As I already used {{CURRENTDAY}} {{CURRENTMONTHNAME}}
in http://it.wikipedia.org/wiki/Template:PaginaPrincipale/Attualita
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
51,52d50
< define("MAG_CURRENTWEEK", 35);
< define("MAG_CURRENTDOW", 36);
61,62d58
<       MAG_CURRENTWEEK,
<       MAG_CURRENTDOW,

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

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

You can see a working test page at
http://wiki.usenet.eu.org/Test

TY
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: http://en.wikipedia.org/wiki/Days_of_the_week#Modern_ordering 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.


Navigation
Links