cleaner code ;)
This commit is contained in:
parent
f696a258e8
commit
b78bbf577f
1 changed files with 2 additions and 2 deletions
|
@ -128,11 +128,11 @@ class EventResource(BaseEvent):
|
|||
m = re.match('(LAST|NEXT)([0-9]*)(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),m.group(3))
|
||||
event_start = "now() - INTERVAL '%s %s'" % m.group(2,3)
|
||||
event_stop = "now()"
|
||||
else:
|
||||
event_start = "now()"
|
||||
event_stop = "now() + INTERVAL '%s %s'" % (m.group(2),m.group(3))
|
||||
event_stop = "now() + INTERVAL '%s %s'" % m.group(2,3)
|
||||
|
||||
return event_start, event_stop
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue