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

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

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

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

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.

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

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?

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