- def __lt__(self, other):
- return self.date < other.date
+ @property
+ def next_date(self):
+ """Return date succeeding date of this Day."""
+ next_datetime = self.datetime + timedelta(days=1)
+ return next_datetime.strftime(DATE_FORMAT)
+
+ def save(self, db_conn: DatabaseConnection):
+ """Add (or re-write) self to database."""
+ db_conn.exec('REPLACE INTO days VALUES (?, ?)',
+ (self.date, self.comment))