Originally written .
I'm not the biggest fan of JavaScript. The primary reason is that many sites overuse it to the point that the completely bog down into nothingness. If you website isn't a web app, this should never happen, and even if that is the case, that's a time for some deep introspection. The second reason is that I'm just not a huge fan of the language and the environment around it. I get why it is the way it is, but I wish we could do better.
This is why I go out of my way to not use JavaScript on my website. That, and the fact that I'd have to write it myself. *shudders*. Ideally I'd also have that JavaScript that works across older browsers, but writing JavaScript that's compatible with Internet Explorer 6 is not my idea of a good time. I could probably make some nice progressive enhancements if I really cared, but I don't, and simplicity has a beauty of it's own.
I write dates on my website in accordance with ISO 8601 and RFC 3339. I find this to be the least confusing date format and try to stick with it whenever I can, even in handwriting and on forms. I also use <time>-tags to enclose any dates I write, since although it's an HTML5 tag, it doesn't cause any issues in older browsers. I dream of a day when everybody else also use them, since in that world, we could convert dates on the fly to the user's prefered format. That way I could have my ISO 8601 everywhere. This, however, doesn't seem to be perceived to be a desirable state for most, since most websites just write dates according to their own locale. Understandable, but a shame.
Since that's a thing I want, I've written a little proof of concept. I've written some dates in a list on the bottom of this page, as I would have written them anywhere else on my site, and I've written a JS script which can change all the dates on the page to whatever format you want. Simply select what format you want from the date selector, and then press the button.
The source code for the script is available if you access the date.js loaded by your browser, or on my Gitlab repo: see time-tag-date-formatter. I'm sure it's full of bugs and just horribly made, and it doesn't work on older browsers. If you have any proposals which will make it cleaner or run on older browsers, merge requests are very welcome. Have fun.