Module:Citation/CS1/Date validation: Difference between revisions

bug fix; strip leading '0' from ymd dates when reformatting;
(sync from sandbox;)
(bug fix; strip leading '0' from ymd dates when reformatting;)
Line 849: Line 849:
t.m = cfg.date_names['inv_local_l'][tonumber(t.m)]; -- convert it to a month name
t.m = cfg.date_names['inv_local_l'][tonumber(t.m)]; -- convert it to a month name
end
end
t.d = t.d:gsub ('0(%d)', '%1'); -- strip leading '0' from day if present
elseif 'ymd' == format_param then -- when converting to ymd
elseif 'ymd' == format_param then -- when converting to ymd
if 1582 > tonumber(t.y) then -- ymd format dates not allowed before 1582
if 1582 > tonumber(t.y) then -- ymd format dates not allowed before 1582