danielhjerresen commited on
Commit
a253752
verified
1 Parent(s): d78e5fa

Update streamlit_app.py

Browse files
Files changed (1) hide show
  1. streamlit_app.py +11 -5
streamlit_app.py CHANGED
@@ -274,16 +274,22 @@ def render_daily_summary_source_basis(
274
  generated_at = summary.get("generated_at")
275
  top_story_count = len(summary.get("top_stories", []))
276
 
 
 
277
  if generated_at:
 
 
 
 
 
 
278
  st.caption(
279
- f"Summary is based on the latest relevant classified articles available "
280
- f"when it was generated at {generated_at}. "
281
- f"{top_story_count} top stories are shown in the summary."
282
  )
283
  else:
284
  st.caption(
285
- "Summary is based on the latest relevant classified articles available "
286
- f"when it was generated. {top_story_count} top stories are shown in the summary."
287
  )
288
 
289
  return summary_df
 
274
  generated_at = summary.get("generated_at")
275
  top_story_count = len(summary.get("top_stories", []))
276
 
277
+ formatted_generated_at = None
278
+
279
  if generated_at:
280
+ parsed = pd.to_datetime(generated_at, errors="coerce", utc=True)
281
+
282
+ if pd.notnull(parsed):
283
+ formatted_generated_at = parsed.strftime("%Y-%m-%d %H:%M UTC")
284
+
285
+ if formatted_generated_at:
286
  st.caption(
287
+ f"Summary generated {formatted_generated_at} "
288
+ f"{top_story_count} top stories included"
 
289
  )
290
  else:
291
  st.caption(
292
+ f"{top_story_count} top stories included in this summary"
 
293
  )
294
 
295
  return summary_df