JSPM

dayjs-jp-format

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 711
  • Score
    100M100P100Q108644F
  • License ISC

Japanese calendar format for dayjs.

Package Exports

  • dayjs-jp-format
  • dayjs-jp-format/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dayjs-jp-format) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

dayjs-jp-format

Actions Status npm version

day.jsのformat関数にて日本の元号を表示するためのプラグインです。
A plugin is an independent module that can be added to Day.js to extend functionality or add japanse calendar features.

Usage

  1. Install the repository

    $ npm install --save dayjs-jp-format
    $ npm install --save dayjs # peer dependency

    or

    $ yarn add dayjs-jp-format
    $ yarn add dayjs # peer dependency
  2. Import the jp format

     import { jpFormat } from 'dayjs-jp-format' // load on demand
    
     dayjs.extend(jpFormat) // use plugin
    
     const date = '2020-06-24'
    
     dayjs(date).format('rrrr') // --> 令和02

Format

Format Output Description
rr 令和 日付に応じた元号
rrrr 令和02 日付に応じた和暦(年は除く)