removing seconds from timestamp; wider column for name when printing ls/ ps
This commit is contained in:
@@ -24,7 +24,8 @@ class TimeSlot():
|
||||
|
||||
@start.setter
|
||||
def start(self, d: datetime):
|
||||
self._start = d.timestamp()
|
||||
_d = d.replace(second=0, microsecond=0)
|
||||
self._start = _d.timestamp()
|
||||
|
||||
@property
|
||||
def end(self):
|
||||
@@ -34,9 +35,10 @@ class TimeSlot():
|
||||
|
||||
@end.setter
|
||||
def end(self, d: datetime):
|
||||
if d < self.start:
|
||||
_d = d.replace(second=0, microsecond=0)
|
||||
if _d < self.start:
|
||||
raise ValueError("End date must be after the start date.")
|
||||
self._end = d.timestamp()
|
||||
self._end = _d.timestamp()
|
||||
|
||||
def end_now(self):
|
||||
self.end = datetime.now()
|
||||
|
||||
Reference in New Issue
Block a user