1.3.0 • Published 1 year ago

dayjs-jp-calendar v1.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

dayjs-jp-calendar

npm.io

Jpanese Calendar Plugin for Day.js

Installation

npm i dayjs-jp-calendar --save
# OR
pnpm i dayjs-jp-calendar

Usage

import dayjs from 'dayjs'
import jpCalendar from 'dayjs-jp-calendar'
// OR
import { jpCalendar } from 'dayjs-jp-calendar'

dayjs.extend(jpCalendar)

const date = '2023-11-13'

dayjs(date).format('RRRR') // --> 令和5
dayjs(date).format('RRR') // --> 令和
dayjs(date).format('RR') // --> R5
dayjs(date).format('R') // --> R

dayjs(date).format('rr') // --> ㋿5
dayjs(date).format('r') // --> ㋿

dayjs(date).format('YYYY(RR)/MM/DD') // --> 2023(R5)/11/13
dayjs(date).format('YYYY(rr)/MM/DD') // --> 2023(㋿5)/11/13

Test Coverage

 % Coverage report from v8
----------|---------|----------|---------|---------|
File      | % Stmts | % Branch | % Funcs | % Lines |
----------|---------|----------|---------|---------|
All files |    92.3 |    85.71 |     100 |    92.3 |
 index.ts |    92.3 |    85.71 |     100 |    92.3 |
----------|---------|----------|---------|---------|

For Dev

#Install
pnpm i
#Test
pnpm run test
#Build
pnpm run build

Example case

with antd todo

1.3.0

1 year ago

1.2.0

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.0.2

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago