Page MenuHomePhabricator

Parsing errors around year 0
Closed, ResolvedPublic

Description

Year 0 is a bit of an odd beast, see https://en.wikipedia.org/wiki/0_%28year%29

The parsing seems to go wrong in different cases:

  • 0 with precision year gives 0
  • 0 with precision decade or larger gives +00000000000-01-01T00:00:00Z
  • 1+ with precision year works
  • 1-4 with precision decade gives +00000000004-01-01T00:00:00Z
  • 1-49 with precision century gives +00000000049-01-01T00:00:00Z
  • 1-499 with precision millenium gives +00000000499-01-01T00:00:00Z
  • etc

See https://www.wikidata.org/wiki/Q5959 for an example. It's impossible to add the birth date now without causing a parse error on Wikipedia.


Version: unspecified
Severity: major
Whiteboard: u=dev c=backend p=0

Details

Reference
bz71956

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:47 AM
bzimport set Reference to bz71956.
bzimport added a subscriber: Unknown Object (MLST).

https://github.com/wmde/DataValuesJavascript/pull/49 is related to this (and several other report) but not an actual fix for the issue reported.

To be honest I don't understand the issue. You are talking about "parsing errors" but the examples you gave just parse fine without an error. Unfortunately you don't explain what you expect.

(In reply to Thiemo Mättig from comment #1)

https://github.com/wmde/DataValuesJavascript/pull/49 is related to this (and
several other report) but not an actual fix for the issue reported.

To be honest I don't understand the issue. You are talking about "parsing
errors" but the examples you gave just parse fine without an error.
Unfortunately you don't explain what you expect.

On connected wiki's it gives parsing errors, I already got a angry Russian user on my talk page.

If you access the property you get junk like "+00000000005-01-01T00:00:00Z".

And here is the bug to the conceptional issue that leads (among others) to the concrete problem described above.
https://bugzilla.wikimedia.org/show_bug.cgi?id=71289

(In reply to Maarten Dammers from comment #2)

On connected wiki's it gives parsing errors [...] junk like
"+00000000005-01-01T00:00:00Z".

Again, what "parsing error"? Can you please give an example URL or steps to reproduce or the expected output or copy and paste the error message? An ISO date is neither "junk" nor a parsing error. The fact that you see an ISO date is the result of the fallback in the formatter as described in bug 67604.

I would love to tackle this but based on that few information I barely can.

gerritadmin wrote:

Change 166622 had a related patch set uploaded by Thiemo Mättig (WMDE):
Display full year if precision is to high

https://gerrit.wikimedia.org/r/166622

  • This bug has been marked as a duplicate of bug 67604 ***

gerritadmin wrote:

Change 166622 merged by jenkins-bot:
Display full year if precision is to high

https://gerrit.wikimedia.org/r/166622