Tim Starling wrote:
I've written some PHP code to convert date formats from those typed to a user preference. A demonstration is now available at:
http://www.piclab.com/wiki/wiki.phtml?title=Date_demonstration
There's also some information at:
http://meta.wikipedia.org/wiki/Dynamic_dates
Any comments would be appreciated. There's just a few minor things left to do: for example I want to have an option in LocalSettings.php to disable it.
I haven't seen your code, but if you haven't already done so I highly recommend putting the guts of this into Language.php, so it doesn't clutter up the common code, and so other languages that want such an option can adapt it cleanly.
The user option should also override the sitewide setting in Language::date() ($wgAmericanDates true or false -- incidentally, although there were terrible flame wars a few months ago when it was suggested to change the date format used to display timestamps from American to British order, I've not heard a peep since the default got flipped during the server upgrade over a month ago.)
Can I please have whatever access is necessary to enable me to install this on test.wikipedia.org, and ultimately on the live server?
I'll see about setting up a login for you. (Erik probably should get one, too.)
-- brion vibber (brion @ pobox.com)
I haven't seen your code, but if you haven't already done so I highly recommend putting the guts of this into Language.php, so it doesn't clutter up the common code, and so other languages that want such an option can adapt it cleanly.
Good idea, will do.
The user option should also override the sitewide setting in Language::date() ($wgAmericanDates true or false -- incidentally, although there were terrible flame wars a few months ago when it was suggested to change the date format used to display timestamps from American to British order, I've not heard a peep since the default got flipped during the server upgrade over a month ago.)
Okay. I was wondering what that option did.
I'll see about setting up a login for you. (Erik probably should get one, too.)
Thanks.
Brion Vibber wrote:
Tim Starling wrote:
I've written some PHP code to convert date formats from those typed to a user preference. A demonstration is now available at:
http://www.piclab.com/wiki/wiki.phtml?title=Date_demonstration
There's also some information at:
http://meta.wikipedia.org/wiki/Dynamic_dates
Any comments would be appreciated. There's just a few minor things left to do: for example I want to have an option in LocalSettings.php to disable it.
I haven't seen your code, but if you haven't already done so I highly recommend putting the guts of this into Language.php, so it doesn't clutter up the common code, and so other languages that want such an option can adapt it cleanly.
The user option should also override the sitewide setting in Language::date() ($wgAmericanDates true or false -- incidentally, although there were terrible flame wars a few months ago when it was suggested to change the date format used to display timestamps from American to British order, I've not heard a peep since the default got flipped during the server upgrade over a month ago.)
Can I please have whatever access is necessary to enable me to install this on test.wikipedia.org, and ultimately on the live server?
I'll see about setting up a login for you. (Erik probably should get one, too.)
The ISO format is based on numerical dates. Thus for the example it would be 2003-06-24. It includes hyphens and has leading zeros for days and months. To the extent that I have been applying them I would enter such a date as [[2003]]-[[06-24]]. The first hyphen is outside of the link, and I have written redirects for the numerical dates on an as required basis.
Eclecticology
Ray Saintonge wrote:
Brion Vibber wrote:
Tim Starling wrote:
I've written some PHP code to convert date formats from those typed to a user preference. A demonstration is now available at:
http://www.piclab.com/wiki/wiki.phtml?title=Date_demonstration
There's also some information at:
http://meta.wikipedia.org/wiki/Dynamic_dates
Any comments would be appreciated. There's just a few minor things left to do: for example I want to have an option in LocalSettings.php to disable it.
It seems a little bats that at a time when our databse is struggling, we're adding more load to the system for something so trivial. Can't Americans read dates when they're the other way round?
tarquin-
It seems a little bats that at a time when our databse is struggling, we're adding more load to the system for something so trivial.
This should not add substantial load if properly coded, since it's just a search/replace operation with a fairly specific match (only triggers on linked dates). It will help us present a consistent picture throughout all our pages while not giving up some editorial liberty. I therefore fully support the implementation of this feature, unless the code is completely nuts ;-)
Regards,
Erik
Hi, folks!
Erik Moeller wrote:
our pages while not giving up some editorial liberty. I therefore fully support the implementation of this feature, unless the code is completely nuts ;-)
Actually, I looked at the code to make some changes to my private language file and didn't understand it. I know somehow what the code does but not how, because I didn't want to spend that much time decoding all those regexps that make the code pretty cryptic and hard to maintain - with the added bonus of not having /any/ documentation.
Why not rearrange the code into two segments: Segment one would parse the linked date like present in the article into three numerical values: day, month, year. The second segment then would only have to concat those values (maybe with a converted month name) into the final form. This form could be given in the usual "$1 $2 $3 $4" syntax (with e.g. $4 being the month name). That also would take some load off the server that now has to interpret lots of regexp patterns, which isn't too cheap because these patterns normally first get converted into some form of a finite automaton that is eventually given the input string for processing. (At least the code by Tatu Ylonen proceeds in this way.)
Bye! Matthias
wikitech-l@lists.wikimedia.org