use empty workitem_dayfrom_default option for empty start date
This commit is contained in:
parent
efb2c8ba71
commit
536f204a03
1 changed files with 6 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2017 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -147,8 +147,11 @@ class ActivityField(VocabularyField):
|
||||||
def daysAgoByOption(context):
|
def daysAgoByOption(context):
|
||||||
days = 7
|
days = 7
|
||||||
opt = context.view.typeOptions('workitem_dayfrom_default')
|
opt = context.view.typeOptions('workitem_dayfrom_default')
|
||||||
if opt and opt[0].isdigit():
|
if opt:
|
||||||
days = int(opt[0])
|
if opt is True or not opt[0].isdigit():
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
days = int(opt[0])
|
||||||
return (date.today() - timedelta(days)).isoformat()
|
return (date.today() - timedelta(days)).isoformat()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue