Mòdul:Wikidata: diferència entre les revisions

Contingut suprimit Contingut afegit
un espai en blanc que sobra
anys dC menors de 100 i sense 0 al davant, demanat a la discussió
Línia 111:
elseif datatype == 'time' then
-- Dates and times are stored in ISO 8601 format
-- check for negative date, ex. "-0027-01-16T00:00:00Z"
local suffix = ""
local timestamp = snak.datavalue.value.time
Línia 117:
timestamp = '+' .. string.sub(timestamp, 2)
suffix = " aC"
whileelseif string.sub(stryeartimestamp, 12, 13) == '000' dothen
suffix = " dC"
end
local function d(f)
Linha 123 ⟶ 125:
if formatting == 'year' then
-- suppress leading zeros in year
local stryearret, _ = string.gsub(d("Y"), "^0+", "")
return stryearret
while string.sub(stryear, 1, 1) == '0' do
stryear = string.sub(stryear, 2)
end
return stryear
else
returnlocal ret, _ = string.gsub(d("j F Y"), " 0+", " ")
return ret
end