Page MenuHomePhabricator

Turn “stuff” in {minimum,maximum}_quantity parameters for time-type values into actual time values
Closed, ResolvedPublic

Description

Take, for instance, these constraints:

13c6638b-2162-4010-8b8a-cd489916c3ab,620,Range,"{""minimum_quantity"": ""1957-10-04"", ""maximum_quantity"": ""now""}"
d9754c94-b2be-44cf-bcb1-21635b589344,813,Range,"{""minimum_quantity"": ""2001"", ""maximum_quantity"": ""now""}"

Right now, RangeChecker simply takes the minimum value literally as it is, and compares it with PHP’s < operator against the value in the statement, which will be formatted like e. g. +2020-00-00T00:00:00Z (note the leading +). At no point does it attempt to do an actual date comparison, so the results are incorrect.

Event Timeline

Change 351618 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove DataValue objects from test parameters

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

Change 351618 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove DataValue objects from test parameters

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

Change 351628 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Parse and correctly compare time values

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

Change 351628 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Parse and correctly compare time values

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