bikram-sambat-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Bikram Sambat

Utility library to convert date in AD (Gregorian) to Nepali date format BS (Bikram sambat) and vice versa.

Version Twitter Follow

Installation

Using NPM:

npm i bikram-sambat-js

or, using Yarn:

yarn add bikram-sambat-js

Usage

Import package

Using ES6 import:

import BikramSambat, {ADToBS, BSToAD}  from "bikram-sambat-js"

or, using commonJS require

const BS = require('bikram-sambat-js')

BS.ADToBS("2019-08-25")

1. BS to AD conversion

Syntax: BSToAD(date: string): string

BSToAD("2076-05-08") // "2019-08-25"

or,

new BikramSambat('2076-05-08', 'BS').toAD()

2. AD to BS conversion

Syntax: ADToBS(date: Date | string): string

ADToBS("2019-08-25") // "2076-05-08"

or,

new BikramSambat('2019-08-25').toBS()

Package Sidebar

Install

npm i bikram-sambat-js

Weekly Downloads

555

Version

1.0.2

License

MIT

Unpacked Size

116 kB

Total Files

11

Last publish

Collaborators

  • puncoz