API allow to add wrong date values for day and month precision. For example:
+2003-12-00T00:00:00Z with precision = DAY
+2003-00-00T00:00:00Z with precision = MONTH
The values can not be displayed correctly by Wikidata UI.
See P577 value at page as example:
https://www.wikidata.org/w/index.php?title=Q4115189&oldid=1485553016
I fixed such wrong values. But its are created again and again by different users.
See the next discussions as examples:
https://www.wikidata.org/wiki/User_talk:Rdmpage#Date_format
https://www.wikidata.org/wiki/User_talk:Csisc#Corrupted_dates
Steps to reproduce
- Go to https://www.wikidata.org/wiki/Special:ApiSandbox
- Set action = wbcreateclaim
- entity = Q4115189
- snaktype = value
- property = P577
- value = {"time": "+2003-12-00T00:00:00Z", "precision": 11, "timezone": 0, "before": 0, "after": 0, "calendarmodel": "http://www.wikidata.org/entity/Q1985727"}
- token -> click autofill
- Execute request
Actual behavior
Wrong claim is successfully created.
Expected behavior
The API call should fail with invalid-snak code. The claim should not be created. Behavior should be the same as for other wrong date values, for example for "+2003-99-99T00:00:00Z".
Acceptance criteria:
- dates with 00 for the month and precision month or day are no longer accepted by the API
- dates with 00 for the day and precision day are no longer accepted by the API
Notes:
- We need to make sure that the Items with wrong values don't become completely uneditable. It should at the very least be possible to remove the statement with the invalid date.
- Dev team does not clean up existing bad data