Allow for EU date format in strings
His Dad [04-29-15 - 09:50]
Allow for EU date format in strings
diff --git a/timetable.lua b/timetable.lua
index 21fbb38..7b2845c 100644
--- a/timetable.lua
+++ b/timetable.lua
@@ -167,9 +167,19 @@ end
function luatz_esodate ( str ) -- Returns timestamp from M/D/YYYY HH:MM:SS string
local month , day , year ,hour , min , sec = string.match ( str ,"(%d+)/(%d+)/(%d%d%d%d)%s+(%d+):(%d+):(%d+)%s*" )
+ if not year then -- try German DD.MM.YYYY
+ day, month , year ,hour , min , sec = string.match ( str ,"(%d+)%.(%d+)%.(%d%d%d%d)%s+(%d+):(%d+):(%d+)%s*" )
+ end
if not year then
- d( "Invalid Eso timestamp: " .. str)
+ d("History: Invalid Eso timestamp: " .. str .. " Substituting dummy "31/9/1999")
+ year = "1999"
+ month= "9"
+ day = "31"
+ hour= "1"
+ min = "2"
+ sec= "3"
end
+
year = tonumber ( year )
month = tonumber ( month )