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

Function _display_date

agents/wiki-agent/export/monthly_report.py:142–152  ·  view source on GitHub ↗
(node: Dict[str, Any], month: str)

Source from the content-addressed store, hash-verified

140
141
142def _display_date(node: Dict[str, Any], month: str) -> str:
143 matching = [(label, date) for label, date in _node_dates(node) if date.strftime("%Y-%m") == month]
144 candidates = matching or _node_dates(node)
145 if not candidates:
146 return month
147 # Prefer the paper date when this is a publication-month export, otherwise
148 # keep the first matching activity date.
149 for label, date in candidates:
150 if label in {"publish_date", "published"}:
151 return date.strftime("%Y-%m-%d")
152 return candidates[0][1].strftime("%Y-%m-%d")
153
154
155def _normalize_keywords(value: Any) -> List[str]:

Callers 1

_paper_rowsFunction · 0.85

Calls 1

_node_datesFunction · 0.85

Tested by

no test coverage detected