Page MenuHomePhabricator

date handling regressions in SMW 1.4
Closed, ResolvedPublic

Description

Author: info

Description:
As discussed in "other Type:Date glitches", Daniel Werner's "SMW 1.4.0 released", and Izzy's "Errors with date formats in SMW 1.4.0", date formats that used to work no longer work in SMW 1.4.

I put several of these but not all in http://sandbox.semantic-mediawiki.org/wiki/SMW_unit_test:Test_dates ,

The most critical IMO is

The date "2008-02-06" was not understood.

It seems that in SMW Version 1.4f-SVN, the month cannot have a leading
0, it has to be 2008-2-06. That's bad, it's against basic common
ISO8601 formatting and a big regression.

I also noticed a medium problem for ISO8601 lovers:

The date "1999-11-31 23:59:42" was not understood.

But the 'T' separator is optional. Another regression

I noticed some other failing ISO8601 formats on that page, like only
giving hour without minutes and seconds.

Quickly summarizing the other e-mails,

Daniel Werner's "SMW 1.4.0 released" notes increased strictness in parsing, rejecting comma when time precedes date, so e.g.

21:42, 20. Nov. 2008

is not recognized. Also the parser should allow strings around dates and "signature dates" (??)

Izzy's "Errors with date formats in SMW 1.4.0", reports these two dates are not parsed:

01-01-2008
01-1-2008

Version: unspecified
Severity: normal
URL: http://sandbox.semantic-mediawiki.org/wiki/SMW_unit_test:Test_dates

Details

Reference
bz16557

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:28 PM
bzimport set Reference to bz16557.

The leading zero problem and the surrounding space problem are fixed in SVN. I think these are the major issues here, so I downgrade the severity of this bug now. We will also look at the other issues.

publicaddress wrote:

I'm not sure if this is a related issue, but the Factbox and Browse interface no longer (since SMW 1.4.1, I believe) seem to respect the "$wgAmericanDates = true;" setting from LocalSettings.php - all dates appear in those interfaces in long European format (e.g., "11 March 2009"), although they can be entered in almost any format and the computer will sort out what the user means (e.g., entering [[Date::11-12-2009]] or [[Date::2009-11-12]] will show as 12 November, 2009).

This is not exactly the same issue, since it is about output instead of input. SMW does no longer use the MediaWiki date formatting functions, since they are based on PHP functions that support a restricted interval of dates only (UNIX time on a 32bit machine). It might sitll be possible to use this formatting if the date is within the range that is certainly supported or if MW's functions are actually capable of handling (pre)historic dates, too.

All reported cases where there was a regression have now been fixed (updates on wiki page). Note that there is no Nov 31 (which as the reason why the cases with omitted "T" seemed to fail even though this worked). Maybe I will add a clearer error message for this case to avoid such confusions.

Times that consist of an hour only are not supported (if you want to be able to put times before or after the date, the ":" is very useful for identifying them). While this is allowed in ISO, I do not see a compelling use case to have this in SMW. At least it is not a bug.

"Dashless" ISO is not supported, and there is no plan to support it in the future.