Last modified: 2012-11-11 01:13:16 UTC
I tested the scenario below were dates are wrongfully converted. ## Test batch {{#subobject:a1|demo=date|has date=01.01.1977|has value=12}} {{#subobject:a2|demo=date|has date=02.01.1977|has value=34}} --> ZZZ {{#subobject:a3|demo=date|has date=03.01.1977|has value=40}} --> ZZZ {{#subobject:a4|demo=date|has date=04.01.1977|has value=20}} --> ZZZ {{#subobject:a5|demo=date|has date=11.01.1977|has value=16}} --> ZZZ {{#subobject:a6|demo=date|has date=13.01.1977|has value=42}} {{#subobject:a7|demo=date|has date=14.01.1977|has value=72}} {{#subobject:a8|demo=date|has date=15.01.1977|has value=52}} {{#subobject:a9|demo=date|has date=16.01.1977|has value=24}} {{#subobject:a10|demo=date|has date=18.01.1977|has value=42}} {{#subobject:a11|demo=date|has date=19.01.1977|has value=22}} Output is converted to 1 January 1977 18 January 1977 19 January 1977 1 February 1977 --> ZZZ --> wrong 1 March 1977 --> ZZZ --> wrong 1 April 1977 --> ZZZ --> wrong 1 November 1977 --> ZZZ --> wrong 13 January 1977 14 January 1977 15 January 1977 16 January 1977 ## SMW Semantic MediaWiki (Version 1.8 alpha) (1560d5e)
The error still persists using MediaWiki 1.21alpha (e882bab) and Semantic MediaWiki (Version 1.8 beta 2) (69ff80f).
So the issue here is that it's interpreting the dates as mm.dd.yyyy instead of dd.mm.yyyy for the entries you highlighted?
Exactly the dd.mm.yyyy input becomes mm.dd.yyyy output
This behaviour is controlled in the language files. For English, we prefer mm.dd.yyyy over dd.mm.yyyy. I understand that this is the preference in the US. I see that somehow it would be nicer to take into account that "." is used as a separator here (which indicates that it is not a US date), but SMW ignores the nature of the separators when interpreting the date. It just sees "1 2 3" and needs to decide if which date is meant. A quick fix could be to create an EN-gb locale that has a different default. This does not require new date processing mechanisms, just a new file. Would that solve the problem?
To clarify: SMW has a kind of fallback chain of date formats when three numbers are given. If one format is not possible (e.g., 17/01/12 could not be in MM/DD/YY format, even if this is preferred), then then next best will be tried. One can also stop this by not including some formats at all (SMW only tries the formats listed in the language file, not all possible ones).