Last modified: 2014-05-14 13:46:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67253, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65253 - Make TimeValue represent an interval always.
Make TimeValue represent an interval always.
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=backend p=0
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-13 11:25 UTC by Daniel Kinzler
Modified: 2014-05-14 13:46 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel Kinzler 2014-05-13 11:25:56 UTC
TimeValue has the notion of a precision interval given by the "before" and "after" fields, in the unit specified by the "precision" field (e.g. "day").

Currently, both "before" and "after" default to 0. "after" however should never be smaller than 1: the date "March 5 2010" specifies an interval starting at 00:00 that day, and ending 00:00 the next day - so, the precision should be 0, before should be 0, but after should be 1. I would even go so far as to say that setting after to 0 is never valid, no matter what the before value is.
Comment 1 Daniel Kinzler 2014-05-13 11:27:08 UTC
Note that this is especially important for indexing time values for query. It's perhaps best to just make the TimeValue's getAfter method fix any value < 1 to 1.

Another question is how we should handle after=0 in API input.
Comment 2 Thiemo Mättig 2014-05-14 13:46:15 UTC
I suggest to leave this as it is. Setting "after" to 0 means "unspecified". This is similar to setting month or day to 0.

"2014-05-00" means "May 2014", right? Having the day unspecified is ok in the data model. But code that does actual calculations with this value can not simply use it as it is. It will end with "30 April 2014" or fail completely. It must correct 0 to 1 in the calculation.

Same for the "after" value discussed here. I think it's useful to have an "unspecified" value. This allows user A to set a time value to "2014-00-00" and the precision to "YEAR" and that's it. User B can see what user A did and that he had not set an "after" value. If it defaults to "1" you loose this information.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links