Ordinal Dates/Numbers (1st, 2nd, 3rd, etc)

Does anyone know if there is a plugin or any other method to display a date in its ordinal form? For example, today would be the 21st day of June, 2019. I can’t seem to find anything out there on this subject and while I’m sure I can put something together, I thought it couldn’t hurt to ask. Thanks!

The moment.js library does this (among many, many other things) and even does that “in locale” (e.g., many different languages). I don’t have a separate moment-based plugin (at least, not one that’s available yet in the plugin store), but my Calendar Grid Pro plugin does this via moment.

The option you’re looking for in moment’s format function is “Do” - documented here: https://momentjs.com/docs/#/parsing/string-format/

And here’s a CG Pro element using “Do” styled date numbers:

(One notes that ordinal styling is very different for different locales!)

Your question reminds me that I should add a couple more utility functions to CG Pro for doing stuff like this on arbitrary dates…

2 Likes

I will look into these options and I appreciate your response. Thank you!