Last modified: 2010-05-15 15:28:02 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
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)
*** Bug 1215 has been marked as a duplicate of this bug. ***
Will have a look at it in the next days probably.
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.
Commited in 1_4 and HEAD. Will be part of beta5, probably going to be put on live wikimedia sites soon.