rafatjah commited on
Commit
23fee40
Β·
1 Parent(s): 6c3d176

Improve expiry

Browse files
Files changed (1) hide show
  1. home.py +4 -2
home.py CHANGED
@@ -83,7 +83,7 @@ def show_polls():
83
  with table[0]:
84
  st.subheader("Name")
85
  with table[1]:
86
- st.subheader("Expiry")
87
  with table[2]:
88
  st.subheader("Join Button")
89
 
@@ -94,7 +94,9 @@ def show_polls():
94
  with table[0]:
95
  st.write(poll["name"])
96
  with table[1]:
97
- st.write(poll["expiry"])
 
 
98
  with table[2]:
99
  st.button(
100
  f"Join {poll['name']}",
 
83
  with table[0]:
84
  st.subheader("Name")
85
  with table[1]:
86
+ st.subheader("Expire in")
87
  with table[2]:
88
  st.subheader("Join Button")
89
 
 
94
  with table[0]:
95
  st.write(poll["name"])
96
  with table[1]:
97
+ expire_in = poll["expiry"] - datetime.datetime.now()
98
+ formatted_time = '{:02}:{:02}'.format(expire_in.seconds // 3600, (expire_in.seconds // 60) % 60)
99
+ st.text(formatted_time)
100
  with table[2]:
101
  st.button(
102
  f"Join {poll['name']}",