Module:Sandbox/Hellknowz/Test: Difference between revisions

Content deleted Content added
add other two date formats before time
'10:28:27, 3 May 2013' case, geez this is a lot
Line 242:
 
 
if (elements[1] == ELEMENT_ONETWODIGITS) then -- '3' or '10'
if (elements[2] == ELEMENT_WHITESPACE) then -- '3 '
if (elements[3] == ELEMENT_MONTHWORD) then -- '3 May'
Line 264:
if (elements[12] == ELEMENT_TIMEPERIOD) then -- '3 May 2013, 10:38:27 am'
if (numberOfElements == 10) then return checkAndOutput(values[5], values[3], values[1], values[7] + periodHourAdd(values[12]), values[9], values[11]) end
if (elements[10] == ELEMENT_TIMESEPARATOR) then -- ''May 3, 2013, 10:38:'end
end
end
end
end
end
end
end
end
ifelseif (elements[82] == ELEMENT_TIMESEPARATOR) then -- '2013-05-03, 10:'
if (elements[83] == ELEMENT_TIMESEPARATORELEMENT_ONETWODIGITS) then -- ''May 3, 2013, 10:28'
if (elements[104] == ELEMENT_TIMESEPARATOR) then -- '2013-05-03, 10:3828:'
if (elements[5] == ELEMENT_ONETWODIGITS) then -- '10:28:27'
if (numberOfElements == 5) then return checkAndOutput(nil, nil, nil, values[1], values[3], values[5]) end
if (elements[5] == ELEMENT_WHITESPACE or elements[5] == ELEMENT_COMMA) then -- '10:28:27, '
if (elements[6] == ELEMENT_ONETWODIGITS) then -- '10:28:27, 3'
if (elements[7] == ELEMENT_WHITESPACE) then -- '10:28:27, 3 '
if (elements[8] == ELEMENT_MONTHWORD) then -- '10:28:27, 3 May'
if (elements[9] == ELEMENT_WHITESPACE) then -- '10:28:27, 3 May '
if (elements[10] == ELEMENT_FOURDIGITS) then -- '10:28:27, 3 May 2013'
if (numberOfElements == 10) then return checkAndOutput(values[10], values[8], values[6], values[1], values[3], values[5]) end
end
end
Line 288 ⟶ 309:
if (elements[8] == ELEMENT_TIMEPERIOD) then -- '2013-05-03, 10 am'
if (numberOfElements == 8) then return checkAndOutput(values[1], values[3], values[5], values[7] + periodHourAdd(values[8]), nil, nil) end
endelseif (elements[8] == ELEMENT_TIMESEPARATOR) then -- '2013-05-03, 10:'
if (elements[8] == ELEMENT_TIMESEPARATOR) then -- '2013-05-03, 10:'
if (elements[9] == ELEMENT_ONETWODIGITS) then -- '2013-05-03, 10:38'
if (numberOfElements == 9) then return checkAndOutput(values[1], values[3], values[5], values[7], values[9], nil) end
if (elements[10] == ELEMENT_TIMEPERIOD) then -- '2013-05-03, 10:38 am'
if (numberOfElements == 10) then return checkAndOutput(values[1], values[3], values[5], values[7] + periodHourAdd(values[10]), values[9], nil) end
endelseif (elements[10] == ELEMENT_TIMESEPARATOR) then -- '2013-05-03, 10:38:'
if (elements[10] == ELEMENT_TIMESEPARATOR) then -- '2013-05-03, 10:38:'
if (elements[11] == ELEMENT_ONETWODIGITS) then -- '2013-05-03, 10:38:27'
if (numberOfElements == 11) then return checkAndOutput(values[1], values[3], values[5], values[7], values[9], values[11]) end
Line 322 ⟶ 341:
if (elements[8] == ELEMENT_TIMEPERIOD) then -- ''May 3, 2013, 10 am'
if (numberOfElements == 8) then return checkAndOutput(values[5], values[1], values[3], values[7] + periodHourAdd(values[8]), nil, nil) end
endelseif (elements[8] == ELEMENT_TIMESEPARATOR) then -- ''May 3, 2013, 10:'
if (elements[8] == ELEMENT_TIMESEPARATOR) then -- ''May 3, 2013, 10:'
if (elements[9] == ELEMENT_ONETWODIGITS) then -- ''May 3, 2013, 10:38'
if (numberOfElements == 9) then return checkAndOutput(values[5], values[1], values[3], values[7], values[9], nil) end
if (elements[10] == ELEMENT_TIMEPERIOD) then -- ''May 3, 2013, 10:38 am'
if (numberOfElements == 10) then return checkAndOutput(values[5], values[1], values[3], values[7] + periodHourAdd(values[10]), values[9], nil) end
endelseif (elements[10] == ELEMENT_TIMESEPARATOR) then -- ''May 3, 2013, 10:38:'
if (elements[10] == ELEMENT_TIMESEPARATOR) then -- ''May 3, 2013, 10:38:'
if (elements[11] == ELEMENT_ONETWODIGITS) then -- ''May 3, 2013, 10:38:27'
if (numberOfElements == 11) then return checkAndOutput(values[5], values[1], values[3], values[7], values[9], values[11]) end