Michael created this task. Michael added projects: Wikidata, Wikidata Query Builder. Restricted Application added a subscriber: Aklapper.
TASK DESCRIPTION The ParseValueRepository created in T277038 <https://phabricator.wikimedia.org/T277038> turns the user input of `1920-02` into something like `+1920-02-00T00:00:00Z`. That is not nice and we don't want to show that to the user. Therefore, we need to do another API call to format that value and turn it into something like `February 1920`. This is also what happens on Wikidata. [ ] create interface FormatValueRepository with one method the takes the datavalue as produced by the ParseValueRepository and the Property ID [ ] create implementation with fetch, similar to https://github.com/wmde/query-builder/blob/master/src/data-access/FetchSearchEntityRepository.ts Query example: https://www.wikidata.org/w/api.php?action=wbformatvalue&format=json&datavalue={"value":{"after":0,"before":0,"calendarmodel":"http://www.wikidata.org/entity/Q1985727","precision":10,"time":"+1920-02-00T00:00:00Z","timezone":0},"type":"time"}&generate=text/plain&property=P577&errorformat=plaintext&uselang=en&options={"lang":"en"} <https://www.wikidata.org/w/api.php?action=wbformatvalue&format=json&datavalue=%7B%22value%22%3A%7B%22after%22%3A0%2C%22before%22%3A0%2C%22calendarmodel%22%3A%22http%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ1985727%22%2C%22precision%22%3A10%2C%22time%22%3A%22%2B1920-02-00T00%3A00%3A00Z%22%2C%22timezone%22%3A0%7D%2C%22type%22%3A%22time%22%7D&generate=text%2Fplain&property=P577&errorformat=plaintext&uselang=en&options=%7B%22lang%22%3A%22en%22%7D> API help: https://www.wikidata.org/w/api.php?action=help&modules=wbformatvalue That is what the expected datavalue lookes like { "value": { "time": "+1920-02-00T00:00:00Z", "timezone": 0, "before": 0, "after": 0, "precision": 10, "calendarmodel": "http://www.wikidata.org/entity/Q1985727" }, "type": "time" } TASK DETAIL https://phabricator.wikimedia.org/T277057 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Michael Cc: Aklapper, Michael, maantietaja, Akuckartz, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, abian, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs