mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 00:41:05 +03:00
Python backend: Date difference should always return duration in days (#396)
This commit is contained in:
commit
e5da498d15
@ -200,7 +200,7 @@ class Date:
|
||||
|
||||
def __sub__(self, other: object) -> object:
|
||||
if isinstance(other, Date):
|
||||
return Duration(dateutil.relativedelta.relativedelta(self.value, other.value))
|
||||
return Duration(dateutil.relativedelta.relativedelta(days=(self.value - other.value).days))
|
||||
elif isinstance(other, Duration):
|
||||
return Date(self.value - other.value)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user