Module:Calendar: Difference between revisions
From Neodyland Wiki
More actions
bypass the regex test if the string is wrong length |
mNo edit summary |
||
| Line 47: | Line 47: | ||
return nil | return nil | ||
end | end | ||
local year, month, day = ISOdate:match( "(-?%d%d%d%d)-(%d%d)-(%d%d)" ) | -- date string has to start with YYYY-MM-DD date, possibly with a "-" in front | ||
local year, month, day = ISOdate:match( "^(-?%d%d%d%d)-(%d%d)-(%d%d)" ) | |||
if not year then | if not year then | ||
return nil | return nil | ||