(value: Any)
| 37 | |
| 38 | |
| 39 | def parse_date(value: Any) -> datetime: |
| 40 | text = str(value or "") |
| 41 | for fmt in ("%Y-%m-%d", "%Y%m%d"): |
| 42 | try: |
| 43 | return datetime.strptime(text, fmt) |
| 44 | except ValueError: |
| 45 | continue |
| 46 | raise ValueError(f"Invalid date: {value}") |
| 47 | |
| 48 | |
| 49 | def iso_date(value: datetime) -> str: |
no outgoing calls
no test coverage detected