diff options
-rw-r--r-- | sbhs/templatetags/custom_filter.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sbhs/templatetags/custom_filter.py b/sbhs/templatetags/custom_filter.py index 17ab4cc..77f7cba 100644 --- a/sbhs/templatetags/custom_filter.py +++ b/sbhs/templatetags/custom_filter.py @@ -12,4 +12,14 @@ def compare_slot_time(start_time, end_time, now): slot ="pending" else: slot = "finished" - return slot
\ No newline at end of file + return slot + + +@register.simple_tag +def vacant_slot(start_time, end_time, now): + slot = "vacant" + if start_time <= now <= end_time: + slot ="occupied" + elif start_time >= now: + slot ="vacant" + return slot |