diff --git a/shiftregister/app/models.py b/shiftregister/app/models.py index cf3c7a4..aa23702 100644 --- a/shiftregister/app/models.py +++ b/shiftregister/app/models.py @@ -20,6 +20,8 @@ class Shift(models.Model): # todo: add helper amount override field def __str__(self): return f"{self.room.name}: {self.start_at}" + def has_ended(self): + return (self.start_at + self.duration) < timezone.now() class Helper(models.Model): diff --git a/shiftregister/app/templates/shift.html b/shiftregister/app/templates/shift.html index d32f73b..42cf79d 100644 --- a/shiftregister/app/templates/shift.html +++ b/shiftregister/app/templates/shift.html @@ -2,6 +2,7 @@ {% block title %}Schichtansicht{% endblock %} {% block content %} +