Format numbers, dates automatically and semantically.
<data value=123456.789 lang="de-DE" be-intl='{ "style": "currency", "currency": "EUR" }'></data>
emits
<data value=123456.789 lang="de-DE" be-intl='{ "style": "currency", "currency": "EUR" }'>123.456,79 €</data>
The output element provides identical support.
<time lang="ar-EG" datetime=2011-11-18T14:54:39.929Z be-intl='{ "weekday": "long", "year": "numeric", "month": "long", "day": "numeric" }'></time>
emits
<time lang="ar-EG" datetime="2011-11-18T14:54:39.929Z" be-intl="{ "weekday": "long", "year": "numeric", "month": "long", "day": "numeric" }">الجمعة، ١٨ نوفمبر ٢٠١١</time>
We can also employ more semantic syntax:
<data value=123456.789 lang="de-DE" be-intl-style=currency be-intl-currency=EUR></data>
The semantic example above involves a lot of keyboard tapping of the letters "be-intl". To avoid blisters on your itty bitty fingers, we provide an alternative base attribute you can use:
<time lang="ar-EG" datetime="2011-11-18T14:54:39.929Z"
🌐-weekday=long 🌐-year=numeric 🌐-month=long 🌐-day=numeric></time>
Any web server than can serve static files will do, but...
- Install git.
- Fork/clone this repo.
- Install node.
- Open command window to folder where you cloned this repo.
-
npm install
-
npm run serve
- Open http://localhost:3030/demo in a modern browser.
import 'be-intl/be-intl.js';
<script type=module crossorigin=anonymous>
import 'https://esm.run/be-intl';
</script>