forked from ScoDoc/ScoDoc
Meilleur message d'erreur si date abs invalide
This commit is contained in:
parent
f349c8cad9
commit
b5f317083c
@ -229,8 +229,11 @@ def DateRangeISO(date_beg, date_end, workable=1):
|
|||||||
date_end = date_beg
|
date_end = date_beg
|
||||||
r = []
|
r = []
|
||||||
work_saturday = is_work_saturday()
|
work_saturday = is_work_saturday()
|
||||||
cur = ddmmyyyy(date_beg, work_saturday=work_saturday)
|
try:
|
||||||
end = ddmmyyyy(date_end, work_saturday=work_saturday)
|
cur = ddmmyyyy(date_beg, work_saturday=work_saturday)
|
||||||
|
end = ddmmyyyy(date_end, work_saturday=work_saturday)
|
||||||
|
except (AttributeError, ValueError) as e:
|
||||||
|
raise ScoValueError("date invalide !") from e
|
||||||
while cur <= end:
|
while cur <= end:
|
||||||
if (not workable) or cur.iswork():
|
if (not workable) or cur.iswork():
|
||||||
r.append(cur)
|
r.append(cur)
|
||||||
|
Loading…
Reference in New Issue
Block a user