Template:LocaleDate: Difference between revisions

+docs
No edit summary
(+docs)
Line 1: Line 1:
<templatestyles src="LocaleDate/styles.css" /><span class="date-wrapper"><span class="date-day">{{{day}}}</span><span class="date-month">{{{month}}}</span><span class="date-year">{{{year}}}</span></span><noinclude>
<includeonly><templatestyles src="LocaleDate/styles.css" /><span class="date-wrapper"><span class="date-day">{{{day}}}</span><span class="date-month">{{{month}}}</span><span class="date-year">{{{year}}}</span></span></includeonly><noinclude>This template was an experiment in using [[Template:LocaleDate/styles.css|template CSS]] via the TemplateStyles extension to dynamically reformat dates as mdy or dmy based on the user's locale (the locale would need to be read via JavaScript, which would then set some CSS variables accordingly, but the JS code was never written). This hacky attempt failed because the validator used by TemplateStyles to safety-check the CSS does not allow CSS variables. Amazingly MediaWiki still lacks the ability for a template to directly read the user's locale.


[[Category:Utility templates]]
[[Category:Utility templates]]
</noinclude>
</noinclude>