diff options
author | CruiseDevice | 2018-10-24 16:57:21 +0530 |
---|---|---|
committer | CruiseDevice | 2018-10-24 16:57:21 +0530 |
commit | 113918f3a073e94a4f9b6dce25c30a71658e63b9 (patch) | |
tree | 5e05528f393f0ff19163a9f9f199f41aa149a5c8 | |
parent | 841289742d6c89b8a2eb30cea721f46b2389b862 (diff) | |
download | sbhs_server-113918f3a073e94a4f9b6dce25c30a71658e63b9.tar.gz sbhs_server-113918f3a073e94a4f9b6dce25c30a71658e63b9.tar.bz2 sbhs_server-113918f3a073e94a4f9b6dce25c30a71658e63b9.zip |
create custom_filter for vacant_slot
-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 |