npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wareki-tool-kit

v1.1.0

Published

Convert from Western to Japanese calendar

Downloads

13

Readme

wareki-tool-kit

npm version License: MIT

A collection of tools to manipulate the Japanese and Western calendars for javascript and typescript.

Link

日本語の説明書👉JP-README.md

For development👉DEVELOP.md

Installation

npm install wareki-tool-kit
yarn add wareki-tool-kit

Usage

javascript and typescript are supported.

import {toJapaneseCalendar, toGregorian} from 'wareki-tool-kit'

// ⏬toJapaneseCalendar
toJapaneseCalendar('2019年03月23日') // 令和元年3月23日
toJapaneseCalendar('2019/03/23') // 令和元年3月23日
toJapaneseCalendar('2019-03-23') // 令和元年3月23日
// option1(Whether to use numerals or kanji for the original number. Default is false.)
toJapaneseCalendar('2019-03-23', true) // 令和1年3月23日
toJapaneseCalendar('2019-03-23', false) // 令和元年3月23日
// option2(zero-fill. Default is false.)
toJapaneseCalendar('2019-03-03', false, true) // 令和元年03月03日
toJapaneseCalendar('2019-03-03', false, false) // 令和元年3月3日


// ⏬toGregorian
toGregorian('令和2年5月10日') // 2020年5月10日
toGregorian('令和1年5月10日') // 2019年5月10日
toGregorian('令和元年5月10日') // 2019年5月10日
// option(Separator select. Default is 'k'.)
toGregorian('令和2年5月10日', '/')// 2020/5/10
toGregorian('令和2年5月10日', '-')// 2020-5-10
toGregorian('令和2年5月10日', 'k')// 2020年5月10日
// option2(zero-fill. Default is false.)
toGregorian('令和2年5月9日', 'k', true)// 2020年05月09日
toGregorian('令和2年5月9日', 'k', false)// 2020年5月9日
toGregorian('令和2年5月9日', '/', true)// 2020/05/09
toGregorian('令和2年5月9日', '/', false)// 2020/5/9

Supported Japanese calendar

| Japanese Calendar | AD | |:-----------------|----:| | 令和 | 2019| | 平成 | 1989| | 昭和 | 1926| | 大正 | 1912| | 明治 | 1868| | 慶応 | 1865| | 元治 | 1864| | 文久 | 1861| | 万延 | 1860| | 安政 | 1854| | 嘉永 | 1848| | 弘化 | 1844| | 天保 | 1830| | 文政 | 1818| | 文化 | 1804| | 享和 | 1801| | 寛政 | 1789| | 天明 | 1781| | 安永 | 1772| | 明和 | 1764| | 宝暦 | 1751| | 寛延 | 1748| | 延享 | 1744| | 寛保 | 1741| | 元文 | 1736| | 享保 | 1716| | 正徳 | 1711| | 宝永 | 1704| | 元禄 | 1688| | 貞享 | 1684| | 天和 | 1681| | 延宝 | 1673| | 寛文 | 1661| | 万治 | 1658| | 明暦 | 1655| | 承応 | 1652| | 慶安 | 1648| | 正保 | 1644| | 寛永 | 1624| | 元和 | 1615|

License

MIT