do return s end
]]
if (elements[1] == ELEMENT_ONETWODIGITS) then -- '3'
end
end
end
--[[
1-2 digits
Word (month name)
Done -- d M y (3 May)
Whitespace
4 digits
Done -- d M y (3 May 2013)
Whitespace? and Dash
1-2 digits
Word (month name)
4 digits
Done -- d M Y - d M Y (13 May 2013 – 16 February 2014)
Comma? and Whitespace
1-2 digits
Whitespace and/or Letters (am/pm)
Done -- d M y, h p (3 May 2013, 10 am)
Time separator
1-2 digits
Done -- d M y, h:m (3 May 2013, 10:38)
Whitespace and/or Letters (am/pm)
Done -- d M y, h:m p (3 May 2013, 10:38 am)
Time separator
1-2 digits
Done -- d M y, h:m:s (3 May 2013, 10:38:27)
Whitespace and/or Letters (am/pm)
Done -- d M y, h:m:s p (3 May 2013, 10:38:27 am)
Whitespace? and Dash
1-2 digits
Word (month name)
Done -- d M - d M (13 May – 16 June)
4 digits
Done -- d M - d M y (13 May – 16 June 2013)
Whitespace and/or Letters (am/pm)
Done -- h p (10 am)
Time separator
1-2 digits
Done -- h:m (10:38)
Whitespace and/or Letters (am/pm)
Done -- h:m p (10:38 am)
Time separator
1-2 digits
Done -- h:m:s (10:38:27)
Whitespace and/or Letters (am/pm)
Done -- h:m:s p (10:38:27 am)
Dash
1-2 digits
Whitespace
Word (month name)
Whitespace
4 digits
Done -- d-d M y (3–16 May 2013)
Done -- d-d M (3–16 May)
]]
ifelseif (elements[1] == ELEMENT_FOURDIGITS) then -- '2013'
if (numberOfElements == 1) then return checkAndOutput(values[1], nil, nil, nil, nil, nil) end
if (elements[2] == ELEMENT_DATESEPARATOR) then -- '2013-'
if (elements[3] == ELEMENT_ONETWODIGITS) then -- '2013-05'
if (numberOfElements == 3) then return checkAndOutput(values[1], values[3], nil, nil, nil, nil) end
if (elements[4] == ELEMENT_DATESEPARATOR) then -- '2013-05-'
if (elements[5] == ELEMENT_ONETWODIGITS) then -- '2013-05-03'
if (numberOfElements == 5) then return checkAndOutput(values[1], values[3], values[5], nil, nil, nil) end
end
end
end
end
--[[
4 digits
Done -- y (2013)
ymd date separator
1-2 digits
Done -- y-m (2013-05)
ymd date separator
1-2 digits
Done -- y-m-d (2013-05-03)
Whitespace and/or Dash?
1-2 digits
Done -- y-m-d h (2013-05-03 10)
Time separator
1-2 digits
Done -- y-m-d h:m (2013-05-03 10:38)
Time separator
1-2 digits
Done -- y-m-d h:m:s (2013-05-03 10:38:27)
Dash
4 digits
Done -- y-y (2013-2014)
]]
ifelseif (elements[1] == ELEMENT_MONTHWORD) then -- 'May'
if (elements[2] == ELEMENT_WHITESPACE) then -- 'May '
if (elements[3] == ELEMENT_ONETWODIGITS) then -- 'May 3'
if (elements[4] == ELEMENT_COMMA) then -- 'May 3, '
if (elements[5] == ELEMENT_FOURDIGITS) then -- 'May 3, 2013'
if (numberOfElements == 5) then return checkAndOutput(values[5], values[1], values[3], nil, nil, nil) end
end
end
elseif (elements[3] == ELEMENT_FOURDIGITS) then -- 'May 2013'
if (numberOfElements == 3) then return checkAndOutput(values[3], values[1], nil, nil, nil, nil) end
end
end
else
return nil -- the combination of elements was not a recognized one
end
--[[
Word (month name)
Done -- M (May)
Whitespace
1-2 digits
Done -- M d (May 3)
Comma and Whitespace
4 digits
Done -- M d, y (May 3, 2013) {{tick}}
Whitespace? and Dash
Word (month name)
4 digits
Done -- M d, Y - M d, y (May 3, 2013 – February 16, 2014)
Comma? and Whitespace
1-2 digits
Whitespace and/or Letters (am/pm)
Done -- M d, Y, h p (May 3, 2013, 10 am)
Time separator
1-2 digits
Done -- M d, Y, h:m (May 3, 2013, 10:38)
Whitespace and/or Letters (am/pm)
Done -- M d, Y, h:m p (May 3, 2013, 10:38 am)
Time separator
1-2 digits
Done -- M d, Y, h:m:s (May 3, 2013, 10:38:27)
Whitespace and/or Letters (am/pm)
Done -- M d, Y, h:m:s p (May 3, 2013, 10:38:27 am)
Whitespace? and Dash
1-2 digits
Done -- M d-d (May 3–16)
Comma and Whitespace
4 digits
Done -- M d-d, y (May 3–16, 2013)
Word (month name)
Done -- M d - M d, y (May 13 – June 16)
Comma and Whitespace
4 digits
Done -- M d - M d, y (May 13 – June 16, 2013)
4 digits
Done -- M y (May 2013) {{tick}}
Whitespace? and Dash
Word (month name)
4 digits
Done -- M y - M y (May 2013 – February 2014) {{tick}}
Whitespace? and Dash
Word (month name)
Done -- M - M (May – June)
Whitespace
4 digits
Done -- M - M y (May – June 2013)
]]
return nil -- the combination of elements was not a recognized one
end
|