moment-taiwan
A Taiwan calendar system plugin for moment.js.
Status
About
Taiwan calendar is a calendar which used in Taiwan, China. Read more on Wikipedia or see Calendar Converter.
This plugin adds Taiwan calendar support to momentjs library.
Calendar conversion as below,
- Gregorian to Taiwan
year < 1911 : year - 1912
year > 1911 : year - 1911 - Taiwan to Gregorian
year >= 1 : year + 1911
year == 0 : 1912
year < 0 : year + 1912
Where to use it
In Browser
You may use the target/moment-taiwan.js file.
<script src="moment.js"></script><script src="moment-taiwan.js"></script><script> moment().format('tYY/MM/DD');</script>
NodeJS
var tw = ;var date = ;
API
This plugin tries to mimic momentjs api. Basically, when you want to format or parse a string, use tYY
. For example:
m = // Parse a Taiwan datem // 104/01/01 is 2015/01/01 m // 104
License
MIT