add YEAR to LAST/NEXT relative dates

This commit is contained in:
cquest 2016-06-19 16:31:36 +02:00
parent 29907cfc7c
commit 17222abf63

View file

@ -129,7 +129,7 @@ class EventResource(BaseEvent):
m = re.match('(LAST|NEXT)(YEAR|MONTH|WEEK|DAY|HOUR|MINUTE)',when)
if m is not None:
when = m.group(1)+'1'+m.group(2)+'S'
m = re.match('(LAST|NEXT)([0-9]*)(YEAR|MONTHMONTH|WEEK|MINUTE|HOUR|DAY)S',when)
m = re.match('(LAST|NEXT)([0-9]*)(YEAR|MONTH|WEEK|MINUTE|HOUR|DAY)S',when)
if m is not None:
if m.group(1) == 'LAST':
event_start = "now() - INTERVAL '%s %s'" % m.group(2,3)