Content deleted Content added
→Date handling: good |
→Bug in fetching referenced data: new section |
||
Line 269:
: Thanks {{u|Johnuniq|John}}. I think I had most of that functionality, as well as the BC/BCE and dmy/mdy/y functionality in [[Module:Wikidata]] in the getDateValue function, which dealt with any date BC or AD - I needed that for dob of notable Romans, etc. although the code was hard to read because I was using the timestamp and manipulating that directly. For greater flexibility in this module, I decided to use the mw.wikibase.formatPropertyValues() function – which always returns dmy format dates with BCE as appropriate – because that can be used on properties that are qualifiers as well. I'll need that later as fewer properties are defined and more values are stored as properties of qualifiers (like property:creator - qualifier:has role - item:video game artist instead of property:video game artist). Things like marriages have start-date and end-date that are in qualifiers. Anyway, I think I've managed to create a local function that takes the date in dmy+BCE format and outputs it in whatever format is wanted for use in article infoboxes. I've put a wrapper around it so that it's exported and can be invoked. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 04:00, 21 January 2017 (UTC)
::Good, and I'm sure Wikidata has many quirks which require dedicated code. I just wanted to say that if more stuff such as date differences or adding time deltas were ever needed, Module:Date is available. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 05:59, 21 January 2017 (UTC)
== Bug in fetching referenced data ==
At [[Edward Bergh]] I added a second date at [[d:Q5572078]] with year-only accuracy, as that's what I can easily find a reference for atm. Now that there's a reference, it displays the date in the infobox. However, it fetches the *unreferenced* date (with day-accuracy) rather than the referenced one (with year-accuracy). Not a big deal, since [https://www.wikidata.org/w/index.php?title=Q5572078&diff=437849800&oldid=437848585 changing the rank] causes the correct one to show, but this is probably an edge-case that should be fixed ({{ping|RexxS|p=}}). Thanks. [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 16:35, 28 January 2017 (UTC)
|