模块:Citation/CS1/Date validation:修订间差异

imported>Liangent
test
imported>Liangent
无编辑摘要
第326行: 第326行:
local coins_date;
local coins_date;


do return true end
if date_string:match("^%d%d%d%d%-%d%d%-%d%d$") then -- year-initial numerical year month day format
if date_string:match("^%d%d%d%d%-%d%d%-%d%d$") then -- year-initial numerical year month day format
year, month, day=string.match(date_string, "(%d%d%d%d)%-(%d%d)%-(%d%d)");
year, month, day=string.match(date_string, "(%d%d%d%d)%-(%d%d)%-(%d%d)");
第493行: 第494行:
return false; -- date format not one of the MOS:DATE approved formats
return false; -- date format not one of the MOS:DATE approved formats
end
end
do return true end
local result=true; -- check whole dates for validity; assume true because not all dates will go through this test
local result=true; -- check whole dates for validity; assume true because not all dates will go through this test
if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then -- YMD (simple whole date)
if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then -- YMD (simple whole date)