Spaces:
Sleeping
Sleeping
Update streamlit_app.py
Browse files- 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
|
| 280 |
-
f"
|
| 281 |
-
f"{top_story_count} top stories are shown in the summary."
|
| 282 |
)
|
| 283 |
else:
|
| 284 |
st.caption(
|
| 285 |
-
"
|
| 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
|