Module:Wikidata: Difference between revisions

Content deleted Content added
add local "wiki"
m Cleanup/Typo fixing, typo(s) fixed: millenium → millennium (4), .. mw → .. mW (2) using AWB
Line 30:
[4] = "$100.000 Jahren", -- precision: hundred thousand years
[5] = "$10.000 Jahren", -- precision: ten thousand years
[6] = "$1. Jahrtausend", -- precision: milleniummillennium
[7] = "$1. Jahrhundert", -- precision: century
[8] = "$1er", -- precision: decade
Line 110:
out[#out + 1] = "[[" .. mw.wikibase.sitelink("Q" .. v2.datavalue.value["numeric-id"]) .. "]]"
else
out[#out + 1] = "[[:d:Q" .. v2.datavalue.value["numeric-id"] .. "|" .. mwmW.wikibase.label("Q" .. v2.datavalue.value["numeric-id"]) .. "]]<abbr title='Article is not yet available in this wiki'>[*]</abbr>"
end
end
Line 310:
end
 
-- precision: 0 - billion years, 1 - hundred million years, ..., 6 - milleniamillennia, 7 - century, 8 - decade, 9 - year, 10 - month, 11 - day, 12 - hour, 13 - minute, 14 - second
local function normalizeDate(date)
date = mw.text.trim(date, "+")
Line 317:
local year = tonumber(yearstr)
-- remove leading zeros of year
return year .. mwmW.ustring.sub(date, #yearstr + 1), year
end
 
Line 338:
end
-- precision is decades, centuries and milleniamillennia
local era
if precision == 6 then era = mw.ustring.gsub(i18n.datetime[6], "$1", tostring(math.floor((math.abs(year) - 1) / 1000) + 1)) end
Line 390:
local function printDatavalueTime(data, parameter)
-- data fields: time [ISO 8601 time], timezone [int in minutes], before [int], after [int], precision [int], calendarmodel [wikidata URI]
-- precision: 0 - billion years, 1 - hundred million years, ..., 6 - milleniamillennia, 7 - century, 8 - decade, 9 - year, 10 - month, 11 - day, 12 - hour, 13 - minute, 14 - second
-- calendarmodel: e.g. http://www.wikidata.org/entity/Q1985727 for the proleptic Gregorian calendar or http://www.wikidata.org/wiki/Q11184 for the Julian calendar]
if parameter then