mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
As written, the strftime module's `getSuffix` method (responsible for returning a date's ordinal string) works correctly for all dates in a month _except_ 11, 12, and 13. The existing code would return a string based on the last digit of the date. In American English, these three dates use the `th` suffix rather than `st`, `nd`, or `rd`. This refactor/bug fix draws inspiration from Rails' ActiveSupport ordinal inflector: https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.rb The Ruby code above is designed to work with any number, so the bug fix to this library is simpler. The test suite is also updated with additional examples to verify the correctness of these changes.