Modulo:Webarchive/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
riscrivo funzione dateFormat
m taglio formati inutili in italiano
Riga 109:
 
--[[--------------------------< formatDate >-----------------------
Verifica il formato di una data (dmy, mdy, iso, ymd) e se lo riconosce
la riformatta in dmy, altrimenti restituisce il valore così com'è
]]
Riga 119:
try_year = tonumber(split[1])
if try_year and try_year > 1900 and try_year < 2200 then -- iso
y, m, d = split[1], month_localized[tonumber(split[2])], split[3]
end
else
Riga 125:
if tableLength(split) == 3 then
try_year = tonumber(split[3])
if try_year and try_year > 1900 and try_year < 2200 thenand
if (split[1] == '1º' or tonumber(split[1])) then -- dmy
d, m, y = split[1], split[2], split[3]
else -- mdy
m, d, y = split[1], split[2], split[3]
end
else
try_year = tonumber(split[1])
if try_year and try_year > 1900 and try_year < 2200 then -- ymd
y, m, d = split[1], split[2], split[3]
end
end
end
end
if tonumber(d) == 1 then d = '1º' end
return ym and mw.ustring.format('%s %s %s', d, m, y) or date
end