Skip to content

Add Error Handling for Invalid Date Formats #1

@swaparup36

Description

@swaparup36

The format_date() function in utils.py doesn't handle invalid date formats. If a user enters a date like "2024-13-45", the program crashes.

File:
utils.py:9

Task:

  • Add try-except block to handle ValueError
  • Return a helpful error message to the user
  • Test with various invalid date formats

Expected Outcome:

# Should handle invalid dates gracefully
format_date("invalid-date")  # Should return error, not crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions