Skip to content

Commit

Permalink
Expanded date parsing error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
smurfier committed May 10, 2014
1 parent 5156aac commit 758ad4d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions @Resources/CScript.lua
Expand Up @@ -1082,8 +1082,17 @@ Parse = {
line = ParseVariables(line, FileName, ''):gsub('%s', ''):gsub('(%b())', function(input) return SKIN:ParseFormula(input) end)
if line == '' then
return default
else
local DateTable = Delim(line, '/')
else
local DateTable = {}
for word in line:gsub('[^/]+') do
local num = tonumber(word)
if num then
table.insert(DateTable, num)
else
break
end
end

if #DateTable == 3 then
return os.time{
day = DateTable[1],
Expand Down

0 comments on commit 758ad4d

Please sign in to comment.