wareki-year-converter
v0.1.1
Published
Gregorian Year to Wareki Year (Japanese Calendar Year) converter
Downloads
5
Readme
Gregorian Calendar to Japanese Year (Wareki) Converter
NOTE
Currently in beta
Installation
npm install wareki-year-converter
Usage
Usage
import { convertToWarekiYear } from 'wareki-year-converter';
...
convertToWarekiYear('2018'); // returns `平成30年`
convertToWarekiYear(moment('2017-01-01'));// returns `平成29年`
Alternate usage
import { WarekiYearConverter } from 'wareki-year-converter';
...
const warekiYearConverter = new WarekiYearConverter();
warekiYearConverter.convertToWarekiYear('2018');
...
warekiYearConverter.convertToWarekiYear(moment('2018-01-01'));