Module:Sandbox/Hellknowz/Test: Difference between revisions

Content deleted Content added
i say fix and break further
fix and add ampm
Line 311:
wasTime = true -- this is a valid final time, so we can check date appended to this
i = 3 -- '10', ':', '28', ':' and '27' are five elements, so we start 3 further from 3
if (elements[4] == ELEMENT_TIMEPERIOD) then -- '10:28:27 am'
if (numberOfElements == 4) then return checkAndOutput(nil, nil, nil, values[1] + periodHourAdd(values[3]), values[3], nil) end
wasTime = true -- this is a valid final time, so we can check date appended to this
i = 4 -- '10', ':', '28', ':', '27' and 'am' are six elements, so we start 4 further from 3
end
end
elseif (elements[4] == ELEMENT_TIMEPERIOD) then -- '10:28 am'
if (numberOfElements == 4) then return checkAndOutput(nil, nil, nil, values[1] + periodHourAdd(values[3]), values[3], nil) end
wasTime = true -- this is a valid final time, so we can check date appended to this (should already be true)
i = 2 -- '10', ':', '28' and 'am' are four elements, so we start 2 further from 3
end
end
Line 337 ⟶ 346:
if (elements[5+i] == ELEMENT_WHITESPACE) then -- '10:28:27, May '
if (elements[6+i] == ELEMENT_ONETWODIGITS) then -- '10:28:27, May 3'
if (elements[7+i] == ELEMENT_COMMA or elements[67+i] == ELEMENT_WHITESPACE) then -- '10:28:27, May 3, '
if (elements[8+i] == ELEMENT_FOURDIGITS) then -- '10:28:27, May 3, 2013'
if (numberOfElements == 8+i) then return checkAndOutput(values[8+i], values[4+i], values[6+i], possibleHour, possibleMinute, possibleSecond) end