Modulu:Wikidata: berrikuspenen arteko aldeak

Ezabatutako edukia Gehitutako edukia
fix time format BC preffixed
fix negative years
31. lerroa:
["afternow"] = "$1 CE", -- how to format positive numbers for precisions 0 to 5
["bc"] = '$1 "BCE"', -- how print negative years
["ad"] = "$1", -- how print positive1st yearscentury AD dates
["bc-addon"] = " BC", -- suffix for negative dates
["ad-addon"] = "" -- suffix for 1st century AD dates
},
["monolingualtext"] = '<span lang="%language">%text</span>',
442 ⟶ 440 lerroa:
local ts = t or timestamp
local form = type(f) == "function" and f(ts) or f -- function in i18n.datetime[precision]
if string.sub(ts, 1, 1) == '-' then ts = '+' .. string.sub(ts, 2) end
return mw.language.new(parameters.lang[1]):formatDate(form, ts)
end
485 ⟶ 484 lerroa:
elseif precision == 10 then -- month
timestamp = timestamp .. " + 1 day" -- formatDate yyyy-mm-00 returns the previous month
ret, _ = string.gsub(d(i18n.datetime[10]), "([ %[])0+", "%1") -- supress leading zeros in year, optionally linked
ret = postFormat(ret) .. calendar_add
ret, _ = string.gsub(ret, "([ %[])0+", "%1") -- supress leading zeros in year, optionally linked
else -- precision 11, day
ret, _ = string.gsub(d(parameters.formatting or i18n.datetime[11]), "([ %[])0+", "%1")
ret = postFormat(ret) .. calendar_add
ret, _ = string.gsub(ret, "([ %[])0+", "%1")
end
return ret, timestamp