Epic Calendar showing future events!

Contrast_Picker
Arcidayne 9 years ago
parent 9b84bfc453
commit 7b582efe7b

@ -129,7 +129,7 @@ function get_cal(epic)
string_offset = "%2b" .. string.format("%02d", math.floor(offset_utc/3600)) .. ":00" string_offset = "%2b" .. string.format("%02d", math.floor(offset_utc/3600)) .. ":00"
end end
local timeMin = os.date("%Y-%m-%dT%I:%M:%S" .. string_offset, os.time()) local timeMin = os.date("%Y-%m-%dT%H:%M:%S", os.time()) .. string_offset
rpage = "https://www.googleapis.com/calendar/v3/calendars/" .. calid .. "/events?key=" .. key .. "&timeMin=" .. timeMin rpage = "https://www.googleapis.com/calendar/v3/calendars/" .. calid .. "/events?key=" .. key .. "&timeMin=" .. timeMin
@ -152,22 +152,26 @@ function get_cal(epic)
ColourNote("cyan", "", "Debugging information:\n", "white", "", "rpage: " .. rpage .. "\nstring_offset: " .. string_offset .. "\noffset_utc: " .. offset_utc .. "\ntimeMin: " .. timeMin, "cyan", "", "\nEnd of information\n") ColourNote("cyan", "", "Debugging information:\n", "white", "", "rpage: " .. rpage .. "\nstring_offset: " .. string_offset .. "\noffset_utc: " .. offset_utc .. "\ntimeMin: " .. timeMin, "cyan", "", "\nEnd of information\n")
end end
if epage.items[1] then if epage then
for i = 1, #epage.items do if epage.items[1] then
starttime, summary = "", epage.items[i].summary or "No summary found!" for i = 1, #epage.items do
starttime, summary = "", epage.items[i].summary or "No summary found!"
if epage.items[i].start.date then if epage.items[i].start.date then
starttime = epage.items[i].start.date starttime = epage.items[i].start.date
else else
starttime = epage.items[i].start.dateTime starttime = epage.items[i].start.dateTime
end end
if #summary < 30 then if #summary < 30 then
summary = summary .. string.rep(" ", 22-#summary) .. "- " summary = summary .. string.rep(" ", 22-#summary) .. "- "
end end
end
table.insert(cal_output, summary .. get_local_time(starttime) .. date_note(starttime))
end end
table.insert(cal_output, summary .. get_local_time(starttime) .. date_note(starttime)) else
ColourNote("cyan", "", "Epic Calendar Error! Something went very wrong trying to get the epage. Let Arcidayne know!")
end end
local header_string = " Upcoming Runs (Local time) " local header_string = " Upcoming Runs (Local time) "

Loading…
Cancel
Save