Maybe edit your earlier post to delete the unhighlighted version?
(I'm very sensitive to unhighlighted code, as I literally can't read it.)
You shouldn't need any conditionals, just a map (or, simpler, an array) of days-of-month to ordinal indicator. Then interpolate
into the output format.
It should be noted that this is an extremely US-English-flavored variant of such a solution. There's no built-in localized version of this because the permutations are too broad.