Page MenuHomePhabricator

SMW 1.8: Problems with date conversion
Closed, DeclinedPublic

Description

I tested the scenario below were dates are wrongfully converted.

Test batch

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)


Version: unspecified
Severity: normal

Details

Reference
bz38723

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:04 AM
bzimport set Reference to bz38723.
bzimport added a subscriber: Unknown Object (MLST).
Unknown Object (User) added a comment.Nov 3 2012, 10:36 AM

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?

Unknown Object (User) added a comment.Nov 11 2012, 12:36 AM

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).

No updates for two years - is this still an issue? Should this really be high priority?

The Semantic MediaWiki developers requested in https://phabricator.wikimedia.org/T64114 to move their task tracking to https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues and to close remaining tasks in Wikimedia Phabricator. If you still face the problem reported in this task in a supported version of SMW, please feel free to transfer your report to https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues . We are sorry for the inconvenience.