
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
dayjs-jp-era
Advanced tools
dayjsのformatにて日本の元号を表示するプラグインです。
https://github.com/hyakt/dayjs-jp-format さんをフォークしてます。
理由:平成30年のときに「平成30」、令和4年のとき「令和4年」と表記されてしまっていたため。
npm install --save dayjs-jp-format
npm install --save dayjs # peer dependency
or
yarn add dayjs-jp-format
yarn add dayjs # peer dependency
import { jpFormat } from 'dayjs-jp-era'
dayjs.extend(jpFormat) // use plugin
const date = '2020-06-24'
const result = dayjs(date).format('rrrr')
console.log(result); //-> 令和2
const result = dayjs(date).format('rrrr年')
console.log(result); //-> 令和2年
const result = dayjs(date).format('rrr')
console.log(result); //-> 令和2年
const result = dayjs(date).format('rr')
console.log(result); //-> 令和
Format | Output | Description |
---|---|---|
rrrr | 令和2 | 日付に応じた和暦(年は除く) |
rrr | 令和2年 | 年あり |
rr | 令和 | 日付に応じた元号 |
FAQs
Japanese Era format for dayjs.
The npm package dayjs-jp-era receives a total of 28 weekly downloads. As such, dayjs-jp-era popularity was classified as not popular.
We found that dayjs-jp-era demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.