Last modified: 2011-12-10 08:11:03 UTC
Why doesn't SMW use MediaWiki's date formatting methods?
I'm not completely sure as Markus wrote this code, but as I understand it, SMW supports date formats that MW does not. It's probably possible to make more use of MediaWikis native data handling though. There is some TODO in the code of the date handling class about that. Since the latest version, some MW parsing methods are used, so that's already a start of such changes. If anyone wants to tackle this, feel free I'd say. If you know how MWs data handling shizzle, you can do this.
I know MW but not SMW so much.
The parsing and formatting code is all here: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Time.php?view=markup When changes are made, care will need to be taken not to break currently supported behavior. Now I think about it, we really ought to have unit tests for the DataValue classes.
What behavior could rely on how the dates are *displayed*?
Well, if SMW supports formats that MW does not, and you break support of these formats, people that want their dates shown in these will get mad at you :)
Well yes, that of course :)
Created attachment 9645 [details] New format type mediawiki Can you check the patch. I introduced a new format #mediawiki which uses mediawiki i18n functions. It can't handle all dates but that isn't a problem in most cases.
Patch committed in r105676.
Great, I just tested it. That is a nice enhancement depending on $wgLanguageCode. I does not really matter but perhaps #mw would be sufficient to set this format for the printout request.
From user's point of view neither mw nor mediawiki doesn't make sense. It's a implementation detail and they are only looking for pretty formatting that works in their language.