Skip to content

_parse_date()

Class: JobsAustriaCacheSynchronizer
File: jobs_austria_cache_synchronizer.py ยท line 228

Parses DD.MM.YYYY strings into a date object; returns None on failure.

Signature

Parameters val
Returns not annotated
Async No
Visibility Private

Implementation

def _parse_date(val):
    """Parses DD.MM.YYYY strings into a date object; returns None on failure."""
    if not val or pd.isna(val):
        return None
    try:
        return datetime.strptime(str(val).strip(), "%d.%m.%Y").date()
    except (ValueError, TypeError):
        return None