Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GoogleCalendar = {
- MatchLink = '<link.-rel=.-alternate.-href=["\'](.-)["\']',
- MatchItem = '<entry.-</entry>',
- MatchItemID = '<id.->(.-)</id>',
- MatchItemLink = '<link.-href=["\'](.-)["\']',
- MatchItemDesc = '<summary.->(.-)</summary>',
- --MatchItemDate = 'startTime=["\'](.-)["\']', Old format
- MatchItemDate = '<summary.->(.-)</summary>',
- MergeItems = false,
- ParseDate = function(s)
- local Date = {}
- --local MatchTime = '(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d)%:(%d%d)%:(%d%d)%.%d+(.-)$'
- --local MatchDate = '(%d%d%d%d)%-(%d%d)%-(%d%d)$'
- --When: Thu 1 Jan 2015 13:00 to 14:00
- local MatchTime = '(%d%d) (%u%a%a) (%d%d%d%d) (%d%d)[:](%d%d)'
- local MatchTime2 = '(%d) (%u%a%a) (%d%d%d%d) (%d%d)[:](%d%d)'
- local MatchDate = '(%d%d) (%u%a%a) (%d%d%d%d)'
- local MatchDate2 = '(%d) (%u%a%a) (%d%d%d%d)'
- if s:match(MatchTime) then
- --Date.year, Date.month, Date.day, Date.hour, Date.min, Date.sec, Date.Offset = s:match(MatchTime)
- Date.day, Date.month, Date.year, Date.hour, Date.min = s:match(MatchTime)
- Date.sec = 0
- Date.Offset = os.date("%Z")
- elseif s:match(MatchTime2) then
- Date.day, Date.month, Date.year, Date.hour, Date.min = s:match(MatchTime2)
- Date.sec = 0
- Date.Offset = os.date("%Z")
- elseif s:match(MatchDate) then
- --Date.year, Date.month, Date.day = s:match(MatchDate)
- Date.day, Date.month, Date.year = s:match(MatchDate)
- elseif s:match(MatchDate2) then
- Date.day, Date.month, Date.year = s:match(MatchDate2)
- end
- return Date
- end
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement