Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f1becd374 |
15
app.py
15
app.py
@@ -427,7 +427,20 @@ def api_calendar_sync_all():
|
|||||||
summary = (evt.get('summary') or '').strip()
|
summary = (evt.get('summary') or '').strip()
|
||||||
if not summary:
|
if not summary:
|
||||||
continue
|
continue
|
||||||
text = f"【{evt['time']}】{summary}" if evt.get('time') else summary
|
date_str = evt.get('date', '')
|
||||||
|
if date_str:
|
||||||
|
try:
|
||||||
|
parts = date_str.split('-')
|
||||||
|
date_label = f"{int(parts[1])}月{int(parts[2])}日"
|
||||||
|
except:
|
||||||
|
date_label = date_str
|
||||||
|
else:
|
||||||
|
date_label = ''
|
||||||
|
time_str = evt.get('time', '')
|
||||||
|
prefix = f"【{date_label} {time_str}】" if date_label and time_str else \
|
||||||
|
(f"【{date_label}】" if date_label else \
|
||||||
|
(f"【{time_str}】" if time_str else ''))
|
||||||
|
text = f"{prefix}{summary}" if prefix else summary
|
||||||
loc = evt.get('location', '')
|
loc = evt.get('location', '')
|
||||||
if loc:
|
if loc:
|
||||||
text += f" @{loc}"
|
text += f" @{loc}"
|
||||||
|
|||||||
Reference in New Issue
Block a user