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=["\'](.-)["\']', Thomas
- MatchItemDate = '<summary.->(.-)</summary>',
- MergeItems = false,
- ParseDate = function(s)
- local Date = {}
- --When: Mon Jan 26, 2015 12:30pm to 2pm
- local MatchTime = '(%u%a%a) (%d+)[,] (%d%d%d%d) (%d+)[:](%d+)'
- local MatchTimep = '(%u%a%a) (%d+)[,] (%d%d%d%d) (%d+)[:](%d+)pm'
- local MatchTime2 = '(%u%a%a) (%d)[,] (%d%d%d%d) (%d+)'
- local MatchTime2p = '(%u%a%a) (%d)[,] (%d%d%d%d) (%d+)pm'
- local MatchTime3 = '(%u%a%a) (%d)[,] (%d%d%d%d) (%d)'
- local MatchTime3p = '(%u%a%a) (%d)[,] (%d%d%d%d) (%d)pm'
- local MatchDate = '(%u%a%a) (%d+)[,] (%d%d%d%d)'
- if s:match(MatchTime) then
- Date.month, Date.day, Date.year, Date.hour, Date.min = s:match(MatchTime)
- Date.sec = 0
- elseif s:match(MatchTimep) then
- Date.month, Date.day, Date.year, Date.hour, Date.min = s:match(MatchTimep)
- Date.hour = 12 + Date.hour
- Date.sec = 0
- elseif s:match(MatchTime2) then
- Date.month, Date.day, Date.year, Date.hour = s:match(MatchTime2)
- Date.min = 0
- Date.sec = 0
- elseif s:match(MatchTime2p) then
- Date.month, Date.day, Date.year, Date.hour = s:match(MatchTime2p)
- Date.hour = 12 + Date.hour
- Date.min = 0
- Date.sec = 0
- elseif s:match(MatchTime3) then
- Date.month, Date.day, Date.year, Date.hour = s:match(MatchTime3)
- Date.min = 0
- Date.sec = 0
- elseif s:match(MatchTime3p) then
- Date.month, Date.day, Date.year, Date.hour = s:match(MatchTime3p)
- Date.hour = 12 + Date.hour
- Date.min = 0
- Date.sec = 0
- elseif s:match(MatchDate) then
- Date.month, Date.day, Date.year = s:match(MatchDate)
- elseif s:match(MatchDate2) then
- Date.month, Date.day, Date.year = s:match(MatchDate2)
- end
- return Date
- end
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement