(value: Any)
| 48 | |
| 49 | |
| 50 | def parse_date(value: Any) -> Optional[datetime]: |
| 51 | text = str(value or "").strip() |
| 52 | if not text: |
| 53 | return None |
| 54 | for fmt in ("%Y-%m-%d", "%Y%m%d"): |
| 55 | try: |
| 56 | return datetime.strptime(text, fmt) |
| 57 | except ValueError: |
| 58 | continue |
| 59 | return None |
| 60 | |
| 61 | |
| 62 | def iso_date(value: datetime) -> str: |
no outgoing calls
no test coverage detected