Skip to content

Commit

Permalink
Fixed datetime format
Browse files Browse the repository at this point in the history
  • Loading branch information
clr-li authored and devxpy committed Feb 12, 2024
1 parent cd991b5 commit e985052
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions daras_ai_v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1519,14 +1519,12 @@ def _render_after_output(self):
if "seed" in self.RequestModel.schema_json():
seed = st.session_state.get("seed")
caption += f' with seed <span style="color: black;">{seed}</span> '
try:
format_created_at = st.session_state.get(
"created_at", datetime.datetime.today()
).strftime("%d %b %Y %-I:%M%p")
except:
format_created_at = format_created_at = st.session_state.get(
"created_at", datetime.datetime.today()
)
created_at = st.session_state.get(
StateKeys.created_at, datetime.datetime.today()
)
if not isinstance(created_at, datetime.datetime):
created_at = datetime.datetime.fromisoformat(created_at)
format_created_at = created_at.strftime("%d %b %Y %-I:%M%p")
caption += f' at <span style="color: black;">{format_created_at}</span>'
st.caption(caption, unsafe_allow_html=True)

Expand Down

0 comments on commit e985052

Please sign in to comment.