Изменения
исправление
if not args[1] then return err end
if not args[1] then return err end
local strin = args[1]
local strin = args[1]
local year, month, day
if not not strin:match( "(-?%d%d%d%d)-(%d%d)-(%d%d)" ) then
year, month, day = strin:match( "(-?%d%d%d%d)-(%d%d)-(%d%d)" )
elseif not not strin:match( "(-?%d%+)-(%d+)-(%d+)" ) then
year, month, day = strin:match( "(-?%d%+)-(%d+)-(%d+)" )
elseif not not strin:match( "(%d%d)%.(%d%d)%.(-?%d%d%d%d)" ) then
day, month, year = strin:match( "(%d%d)%.(%d%d)%.(-?%d%d%d%d)" )
elseif not not strin:match( "(%d+)%.(%d+)%.(-?%d+)" ) then
day, month, year = strin:match( "(%d+)%.(%d+)%.(-?%d+)" )
end
if not year then return error(args[1] .. " is not a yyyy-mm-dd or dd.mm.yyyy format")
end
local jdate = {["year"]=purif(year), ["month"]=purif(month), ["day"]=purif(day)}
local gdate = jd2gri(jul2jd(jdate))
local bc,wd,wm,wy,sq_brts =
local bc,wd,wm,wy,sq_brts =
is(args["bc"]),
is(args["bc"]),
else yearmark = trim(args["yearmark"]) or "года" end
else yearmark = trim(args["yearmark"]) or "года" end
return double_couple(jdate, gdate, wd, wm, wy, sq_brts, yearmark)
return double_couple(jdate, gdate, wd, wm, wy, sq_brts, yearmark)
end
end
return p
return p