Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kentang2017 authored Sep 15, 2024
1 parent 0898c96 commit e40d60c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ def get_file_content_as_string1(path):
with st.sidebar:
pp_date=st.date_input("日期",pdlm.now(tz='Asia/Shanghai').date())
pp_time=st.time_input("時間",pdlm.now(tz='Asia/Shanghai').time())

# 設置時間初始值
if 'pp_time' not in st.session_state:
st.session_state.pp_time = pdlm.now(tz='Asia/Shanghai').time()

# 使用儲存的時間初始值
pp_time = st.time_input("時間", value=st.session_state.pp_time)
st.session_state.pp_time = pp_time
p = str(pp_date).split("-")
pp = str(pp_time).split(":")
y = int(p[0])
Expand Down

0 comments on commit e40d60c

Please sign in to comment.