@dipser/wmlang.js

1.0.1 • Public • Published

wmlang.js

Demo

http://tools.bitfertig.de/wmlang.js/

Install

npm i @dipser/wmlang.js

Usage

<script type="module">
import { month, weekday } from '@dipser/wmlang.js';
console.log( weekday(1, 'de') ); // => Montag
console.log( month(1, 'de') ); // => Januar
</script>

How it works

function month(month, locale = 'en') {
    let intl = new Intl.DateTimeFormat(locale, { month: 'long' });
    return intl.format( new Date(1970, Number(month) - 1, 1) );
}
month(2, 'de'); // => Februar

More

Package Sidebar

Install

npm i @dipser/wmlang.js

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

8.95 kB

Total Files

6

Last publish

Collaborators

  • dipser