mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Python backend: Date difference should always return duration in days
This commit is contained in:
parent
d92ae2ccfd
commit
4c9bff1b74
@ -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