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
},
["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
ret = postFormat(ret) .. calendar_add
ret, _ = string.gsub(ret, "([ %[])0+", "%1") -- supress leading zeros in year, optionally linked
else -- precision 11, day
ret
ret = postFormat(ret) .. calendar_add
ret, _ = string.gsub(ret, "([ %[])0+", "%1")
end
return ret, timestamp
|