Skip to content

Add support for ordinal day formatting #561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mustafadakhel
Copy link

This PR introduces support for formatting day-of-month ordinal numbers (e.g., "1st", "2nd").
#559

Feature Addition: Day-of-Month Ordinal Formatting

  • Added dayOrdinal method to DateTimeFormatBuilder for formatting ordinal day numbers using the customizable DayOrdinalNames.
  • The DayOrdinalNames is used to define the list of ordinal day names, with validation ensuring exactly 31 elements, and a predefined ENGLISH instance.
  • Introduced OrdinalDayDirective.
  • Added test coverage for the new functionalities.

@mustafadakhel
Copy link
Author

I am still not 100% sure if aiming for the max possible number of days in a month (31) is a good approach, if anyone has a better solution, you're more than welcome to share

@mustafadakhel mustafadakhel reopened this Jul 25, 2025
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.

1 participant