tzpage = "https://maps.googleapis.com/maps/api/timezone/json?location=28.4158,-81.2989×tamp=" .. time .. "&key=AIzaSyBv_QnejlevQTnNxF3sF-j0NxzkDLOv4fY" -- Gets offset data for Eastern Time Zone
local xyear, xmonth, xday = string.match(dateTime, "(%d+)%-(%d+)%-(%d+)") -- Date format is displayed as yyyy-mm-dd
local xhour, xmin = string.match(dateTime, "%a(%d+):(%d+)") -- Time format is displayed as Thh:mm
local xyear, xmonth, xday = string.match(dateTime, "(%d+)%-(%d+)%-(%d+)")
local xhour, xmin = string.match(dateTime, "%a(%d+):(%d+)")
local event_time = os.time({year = xyear, month = xmonth, day = xday, hour = xhour or 23, min = xmin or 59, sec = 0}) -- Gets epoch time for event time
local event_time = os.time({year = xyear, month = xmonth, day = xday, hour = xhour or 23, min = xmin or 59, sec = 0})
local utc_event_time = event_time-get_eastern_offset(event_time) -- Sets UTC's time for the event
local utc_event_time = event_time - tonumber(eastern_offset)
local utctime, localtime = os.date("!*t", utc_event_time), os.date("*t", utc_event_time) -- Sets table data for events based on UTC's time of the event
local utctime, localtime = os.date("!*t", utc_event_time), os.date("*t", utc_event_time)
localtime.isdst = false
local localoffset = os.difftime(os.time(utctime), os.time(localtime)) -- Sets the time difference between UTC and local time at the time of the event UTC
local localoffset = os.difftime(os.time(utctime), os.time(localtime))
return os.date("%A, %B %d %Y at %I:%M%p", (utc_event_time-localoffset)) -- Should return local time of the event
return os.date("%A, %B %d %Y at %I:%M%p", (utc_event_time-localoffset))
end
function date_note(dateTime)
@ -103,25 +168,28 @@ function date_note(dateTime)
end
end
-- Get calendar information functions
function get_cal(epic)
async_ok, async = pcall (require, "async")
local cal_output = {}
local epic_list, key, calid = "all if icefall inferno oc", "AIzaSyAHEnr8iiK42hzM21pXSbTrBIQ2ezEEUHA", ""
if string.match(epic_list, epic:lower()) then
if epic:lower() == "icefall" or epic:lower() == "if" then
ColourNote("white", "blue", "Epic Calendar Error: Status failed with code: " .. status .. ". Please try again. If problem persists, please contact Arcidayne.")
end
if SetEpicDebug == 1 then
@ -170,7 +249,7 @@ function get_cal(epic)
end
end
else
ColourNote("cyan", "", "Epic Calendar Error! Something went very wrong trying to get the epage. Let Arcidayne know!")
ColourNote("cyan", "", "Epic Calendar Error: Something went very wrong trying to get the epage. Let Arcidayne know!")
end
local header_string = " Upcoming Runs (Local time) "