diff --git a/timefhuman/data.py b/timefhuman/data.py index 065cfd7..b20e3f0 100644 --- a/timefhuman/data.py +++ b/timefhuman/data.py @@ -18,7 +18,7 @@ def share(self, property, other, setter=setattr): setter(self, property, others) elif others is None and mine is not None: setter(other, property, mine) - + def isnumeric(self): return False @@ -178,7 +178,9 @@ def __add__(self, other): 3/5 """ assert isinstance(other, int) - return DayToken(self.month, self.day + other, self.year) + d = datetime.date(self.year, self.month, self.day) + d = d + datetime.timedelta(days=other) + return DayToken(d.month, d.day, d.year) def __radd__(self, other): """ @@ -187,7 +189,9 @@ def __radd__(self, other): 3/5 """ assert isinstance(other, int) - return DayToken(self.month, self.day + other, self.year) + d = datetime.date(self.year, self.month, self.day) + d = d + datetime.timedelta(days=other) + return DayToken(d.month, d.day, d.year) def datetime(self, now): return datetime.datetime(self.year, self.month, self.day)