Noisy Pillaging Monster

    dayjs-jp-format
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    dayjs-jp-format

    Actions Status

    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 日付に応じた和暦(年は除く)

      This feature is exclusive to Teams

      Illustration of wombats

      The package file explorer is only available for Teams at the moment.

      We may support exploring this package in the future. Check back soon.

      Install

      npm i dayjs-jp-format

      DownloadsWeekly Downloads

      35

      Version

      1.0.1

      License

      ISC

      Unpacked Size

      3.83 kB

      Total Files

      6

      Last publish

      Collaborators

      • hyakt