Maybe edit your earlier post to delete the unhighlighted version?
(I'm very sensitive to unhighlighted code, as I literally can't read it.)
Understandable, I highlighted my earlier post too
I added this snippet to my blog post as well, so it'll be there for future threads.
You shouldn't need any conditionals, just a map (or, simpler, an array) of days-of-month to ordinal indicator. Then interpolate
’${indicators[$
calNow.get($calConst.DAY_OF_MONTH)]}’
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.
Thanks for the help Sanford. I'm trying this out to see if I can make it work.