0.0.8 • Published 6 years ago
japanese-era-date-converter v0.0.8
japanese-era-date-converter
This module help you to convert Japanese date and Western years.
Installation
for using as a module
All you need is to call this module, like this.
// file top
import JapaneseEraDateConverter from "japanese-era-date-converter";
// in class or function
const inputValue = "R01/05/01";
const settings = {
format: "yyyy/mm/dd"
};
const converter = new JapaneseEraDateConverter({ inputValue, settings });
const convertedValue = converter.execute();
for using as jQuery
Download script in dist folder, and include the script after the jQuery library (unless you are packaging scripts somehow else):
<script src="../dist/jquery.japanese-era-date-converter.js"></script>
And, call like this.
<script>
$(document).ready(function () {
$("#target").japanese_era_date_converter({ format: "yyyy/mm/dd" });
});
</script>
Details
- When text inputted, the text will be converted as format.
- example
- When format is "gee/mm/dd", "2019/04/30" will be "H31/04/30".
- If you'd like to know more, please check Demo Page.
- Supported format is as below.
Contributing
In preparation.