in darabonba/date.py [0:0]
def sub(self, unit, amount):
if unit in ["second", "seconds"]:
return Date((self.date - timedelta(seconds=amount)).isoformat())
elif unit in ["minute", "minutes"]:
return Date((self.date - timedelta(minutes=amount)).isoformat())
elif unit in ["hour", "hours"]:
return Date((self.date - timedelta(hours=amount)).isoformat())
elif unit in ["day", "days"]:
return Date((self.date - timedelta(days=amount)).isoformat())
elif unit in ["week", "weeks"]:
return Date((self.date - timedelta(weeks=amount)).isoformat())
elif unit in ["month", "months"]:
return Date((self.date.replace(month=self.date.month - amount)).isoformat())
elif unit in ["year", "years"]:
return Date((self.date.replace(year=self.date.year - amount)).isoformat())