galuhalifani commited on
Commit
9f5ef9d
·
1 Parent(s): bcde01a

change hours

Browse files
Files changed (1) hide show
  1. src/app.py +2 -27
src/app.py CHANGED
@@ -87,35 +87,10 @@ st.markdown(f"""
87
  </style>
88
  """, unsafe_allow_html=True)
89
 
90
- # offset = None
91
- # local_hour = None
92
-
93
- # if "js_initialized" not in st.session_state:
94
- # st.session_state["js_initialized"] = False
95
-
96
- # if not st.session_state["js_initialized"]:
97
- # offset = st_javascript("new Date().getTimezoneOffset()", key="js-offset")
98
- # if offset is not None:
99
- # st.session_state["js_offset"] = offset
100
- # st.session_state["js_initialized"] = True
101
- # st.rerun()
102
-
103
- # offset = st.session_state.get("js_offset", None)
104
  current_hour = datetime.now().hour
105
 
106
- # if offset is not None:
107
- # timezone_hours = -int(offset) // 60
108
- # local_hour = (current_hour + timezone_hours) % 24
109
- # print("🕒 UTC hour:", current_hour, " | Local hour:", local_hour, flush=True)
110
- # working_hours = (8 <= local_hour < 13) or (17 <= local_hour < 20)
111
- # extra_remark = ""
112
- # else:
113
- # local_hour = (current_hour + 7) % 24
114
- # working_hours = (8 <= local_hour < 13) or (17 <= local_hour < 20)
115
- # extra_remark = " (GMT+7)"
116
-
117
  local_hour = (current_hour + 7) % 24
118
- working_hours = (8 <= local_hour < 13) or (17 <= local_hour < 20)
119
  extra_remark = " (GMT+7)"
120
 
121
  # Sidebar Menu
@@ -304,7 +279,7 @@ if selected == "Chatbot":
304
  st.info("Sorry, due to usage control, the web-based bot is currently paused and will be back on tomorrow.\nFor 24-hour access, you can utilize our WhatsApp Bot at +1 234 423 4277.\n\n")
305
  query = None
306
  else:
307
- st.info(f"Sorry, due to usage control, the web-based bot is only available between 8 AM - 1 PM and between 5 PM - 8 PM{extra_remark}.\nFor 24-hour access, you can utilize our WhatsApp Bot at +1 234 423 4277.\n\n")
308
  query = None
309
 
310
  elif selected == "About":
 
87
  </style>
88
  """, unsafe_allow_html=True)
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  current_hour = datetime.now().hour
91
 
 
 
 
 
 
 
 
 
 
 
 
92
  local_hour = (current_hour + 7) % 24
93
+ working_hours = (8 <= local_hour < 20)
94
  extra_remark = " (GMT+7)"
95
 
96
  # Sidebar Menu
 
279
  st.info("Sorry, due to usage control, the web-based bot is currently paused and will be back on tomorrow.\nFor 24-hour access, you can utilize our WhatsApp Bot at +1 234 423 4277.\n\n")
280
  query = None
281
  else:
282
+ st.info(f"Sorry, due to usage control, the web-based bot is only available between 8 AM - 8 PM{extra_remark}.\nFor 24-hour access, you can utilize our WhatsApp Bot at +1 234 423 4277.\n\n")
283
  query = None
284
 
285
  elif selected == "About":