timex
timex copied to clipboard
English ordinal suffix format option added as {S}
English ordinal suffix format option added as {S}. This adds a two character string to the end of the day such 1st, 14th, 22nd, 23rd.
Summary of changes
Dates can be easier to read sometimes when the ordinal suffix is added to the day of month. Such as:
- February 22nd
- March 10th
- August 31st
- October 3rd
Checklist
- [ ] S format option added to the list in the default tokenizer module. Min/max width set to 2.
- [ ] Directives module sets the :suffix type to use day_of_month parser, same as what day uses to check that the day of month is valid.
- [ ] Formatter checks the padding and calls Timex.ordinal_suffix(date) to get the value.
- [ ] Timex module defines a delegate for the ordinal_suffix function to use Timex.Protocol.
- [ ] Each implementation of Timex.Protocol has a function named ordinal_suffix that determines the suffix. (naivedatetime.ex, datetime.ex, date.ex, erlang.ex)