Spaces:
Sleeping
Sleeping
Improve expiry
Browse files
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("
|
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 |
-
|
|
|
|
|
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']}",
|