Skip to content

fix: corrected date suffix logic for 11th, 12th, and 13th#877

Merged
MarkisDev merged 1 commit intoCCExtractor:mainfrom
vibhutomer:fix-date-suffix
Apr 18, 2026
Merged

fix: corrected date suffix logic for 11th, 12th, and 13th#877
MarkisDev merged 1 commit intoCCExtractor:mainfrom
vibhutomer:fix-date-suffix

Conversation

@vibhutomer
Copy link
Copy Markdown
Contributor

@vibhutomer vibhutomer commented Mar 11, 2026

Description

This PR fixes a date formatting bug where the 11th, 12th, and 13th days of the month were incorrectly displayed with the wrong suffixes (e.g., "11st", "12nd", "13rd").

Proposed Changes

  • Updated the getFormattedDate() function in lib/app/utils/utils.dart.
  • Added an else block to the existing if (day >= 11 && day <= 13) condition. This prevents the subsequent switch (day % 10) statement from executing and incorrectly overwriting the valid 'th' suffix.

Fixes #875

Screenshots

Before (Bug: "12nd"):

Screenshot (889)

After (Fixed: "12th"):

Screenshot (890)

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

@MarkisDev MarkisDev merged commit a4f9629 into CCExtractor:main Apr 18, 2026
1 check passed
NihalDR pushed a commit to NihalDR/ultimate_alarm_clock that referenced this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Incorrect date suffix (11st, 12nd, 13rd) in getFormattedDate

2 participants