Skip to content

fix: handle spaced date ranges and prevent endDate loss in parse_date_range #388

Description

@Yugenjr

two logic bugs in transform.py that corrupt date-range parsing and timeline calculations for candidate work history

Date Range Loss for Single Start Dates: In transform_work_experience, when a candidate has a valid startDate (like "Jan 2021") and endDate (like "Dec 2022") parsed from the resume, because startDate contains a month name, it goes through parse_date_range("Jan 2021"). This returns ("Jan 2021", None). The caller then unconditionally overwrites end_date = None, which erases the candidate's actual job end date.

Spaced Date Range Corruption: When the LLM extracts a date range containing spaces around the hyphen (e.g. "Jan 2021 - Mar 2022"), parse_date_range splits the string by spaces into five parts. Since the first part ("Jan") does not contain a hyphen, it falls to the else block and incorrectly combines "Jan" with the end year "2022", returning ("Jan 2022", None).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions