Page MenuHomePhabricator

Handle date formats like 1980x, 1980UTC, 'century' more consistently
Closed, ResolvedPublic

Description

entering dates like '1987x' (or replace x with any character), one gets an error:

"Precision higher thay 'DAY' is not supported yet"


Version: unspecified
Severity: normal

Details

Reference
bz64558

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:12 AM
bzimport set Reference to bz64558.
bzimport added a subscriber: Unknown Object (MLST).
aude created this task.Apr 28 2014, 5:08 PM
aude added a comment.Apr 28 2014, 6:25 PM

this error occurs in the JS time validator (javascript/lib/time/time.Time.validate.js) in DataValuesJavaScript

aude added a comment.Apr 28 2014, 6:29 PM

however the problem is stuff like this

api.php?action=wbparsevalue&format=json&parser=time&values=1990x&options=%7B%7D

returns

precision: 14

if we want to support such value, then it should return max precision of a day (11)

or if we want to regard '1990x' as invalid, then do that.

aude added a comment.Apr 28 2014, 6:31 PM

currently on wikidata, it is regarded as invalid. We should probably stay consistent with that.

aude added a comment.Apr 28 2014, 6:47 PM

problem is in DateTimeParser

php's DateTime happily accepts '1990x' but throws exception with '1990xx'

Change 130138 had a related patch set uploaded by Aude:
Fix handling of dates in format such as 1980x

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

Change 130236 had a related patch set uploaded by Aude:
Handle localised dates (e.g. 'century') more consistently

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

Change 130138 merged by jenkins-bot:
Fix handling of dates in format such as 1980x or 1980UTC

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

Change 130416 had a related patch set uploaded by Aude:
Fix handling of dates in format such as 1980x or 1980UTC

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

Change 130416 merged by jenkins-bot:
Fix handling of dates in format such as 1980x or 1980UTC

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

Change 130236 merged by jenkins-bot:
Handle localised dates (e.g. 'century') more consistently

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

Change 130426 had a related patch set uploaded by Aude:
Handle localised dates (e.g. 'century') more consistently

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

Change 130426 merged by jenkins-bot:
Handle localised dates (e.g. 'century') more consistently

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

Broadening scope of the summary to reflect associated patches. What's left to do?

aude added a comment.Apr 30 2014, 4:10 PM

not really the same issue (this one is resolved), but bug 64545 and bug 64662 are still open.