How can an admin specify the datetime format used by their Discourse installation? We’d like to standardize on ISO 8601 across all our webapps.
You can change the client-side ones with code in
<script> I18n.translations.en.js.dates.time = "HH:mm" I18n.translations.en.js.dates.long_with_year = "DD MMM YYYY HH:mm:ss" I18n.translations.en.js.dates.long_date_with_year = "DD MMM YYYY HH:mm:ss" I18n.translations.en.js.dates.long_no_year_no_time = "DD MMM YYYY" I18n.translations.en.js.dates.long_with_year_no_time = "DD MMM YYYY" </script>
Build the rest using http://momentjs.com/docs/
Thanks, but even when adding those changes you provided, I don’t see the new formats showing up anywhere in a new browser session. Looked on badge listings, the full date-time in a post’s “share” box, hover/tooltips, etc.
Is there anything to do other than adding them to the proper place in admin customizations?
You need to do all of the formats. Put
I18n.translations.en.js.dates in your browser console and expand the object to see the rest.
There really are a lot of formats involved. Even pulling out a list of them from that object via the browser console is a daunting task.