(value: Any)
| 85 | |
| 86 | |
| 87 | def _parse_date(value: Any) -> Optional[datetime]: |
| 88 | text = _clean_text(value) |
| 89 | if not text: |
| 90 | return None |
| 91 | normalized = text.replace("Z", "+00:00") |
| 92 | for candidate in (normalized, normalized[:19], normalized[:10]): |
| 93 | if not candidate: |
| 94 | continue |
| 95 | try: |
| 96 | return datetime.fromisoformat(candidate) |
| 97 | except ValueError: |
| 98 | pass |
| 99 | return None |
| 100 | |
| 101 | |
| 102 | def _node_dates(node: Dict[str, Any]) -> List[Tuple[str, datetime]]: |
no test coverage detected