-
I've been experimenting with the cofiguration file on a test site, but have not been able to find a way of formatting the dates to include a suffix (st, nd, rd or th) after the day of the month. For example, I would like to display "31st May, 2023" instead of "31 May, 2023". Is there a built-in way to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Nikola's date formatting is based on CLDR. I can't see anything that would produce 1st/2nd in the CLDR date field symbol table. Adding those would require either custom JS (which is ugly) or changing Nikola's source code with some manual date formatting — so it might be better to stick to a simpler format. |
Beta Was this translation helpful? Give feedback.
-
I couldn't find the option in the CLDR or LUXOR docs either. I remember it being an option with PHP date formatting though (not that that helps). The main reason I would like a suffix on dates is for screen readers. It wouldn't be too annoying if only a couple of dates were on a page, but I would imagine it would become so with the number of dates on index pages. Would adding custom pretty_date and pretty_modified metadata fields cause any issues with existing variable names? |
Beta Was this translation helpful? Give feedback.
I haven't done that yet, no. I have seen mention of the problem in articles such as this though.
I would rather take the extra time to avoid this potential issue, even if it would only affect a small percentage of vistors.
Then I should be able to manually add "prettier" dates to post metadata and modify the templates to display them without affecting the time HTML tags or Nikola's sorting routines, right?