(node: Dict[str, Any], month: str)
| 140 | |
| 141 | |
| 142 | def _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 | |
| 155 | def _normalize_keywords(value: Any) -> List[str]: |
no test coverage detected