Skip to content
  • Rob Swindell's avatar
    915bd7c7
    Refactor the birthdate parsing logic, add unit test · 915bd7c7
    Rob Swindell authored
    The birthdate parsing is now a lot more robust and will recognize all kinds
    of variants/formats and use range checks to disambiguate provided dates and
    even support partial dates (e.g. year only, year/month and month/year).
    
    The tests should all pass regardless of what the sysop has set for their
    system date format in SCFG.
    
    I had considered using sscanf() for the parsing logic but ended up going with
    strtoul() only and that seems to be working well (as reflected by the passing
    test cases).
    915bd7c7
    Refactor the birthdate parsing logic, add unit test
    Rob Swindell authored
    The birthdate parsing is now a lot more robust and will recognize all kinds
    of variants/formats and use range checks to disambiguate provided dates and
    even support partial dates (e.g. year only, year/month and month/year).
    
    The tests should all pass regardless of what the sysop has set for their
    system date format in SCFG.
    
    I had considered using sscanf() for the parsing logic but ended up going with
    strtoul() only and that seems to be working well (as reflected by the passing
    test cases).
Loading