MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _parse_iso_date

Function _parse_iso_date

deployments/feishu/daily-push-agent/main.py:135–144  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

133def _parse_iso_date(value: Any) -> Optional[date]:
134 text = str(value or "").strip()
135 if not text:
136 return None
137 for fmt, width in (("%Y-%m-%d", 10), ("%Y%m%d", 8)):
138 try:
139 return datetime.strptime(text[:width], fmt).date()
140 except ValueError:
141 pass
142 return None
143
144
145def _paper_date_in_window(paper: Dict[str, Any], start_date: date, end_date: date) -> bool:
146 paper_date = _parse_iso_date((paper or {}).get("publish_date") or (paper or {}).get("published"))
147 if paper_date is None:

Callers 1

_paper_date_in_windowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected