datenp
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

DateNP

Lightweight JavaScript library to convert Nepali and English dates.

Features

  • Lightweight
  • Zero dependencies
  • Supports date conversion from 1975 BS to 2100 BS
  • Easy to use
  • Beginner friendly

Installation

Node

$ npm install datenp

Deno

import DateNP from "https://deno.land/x/datenp/mod.ts";

Browsers

<script type="module">
import DateNP from "https://cdn.jsdelivr.net/npm/datenp@latest/dist/mod.mjs";
</script>

Example

CommonJS

const { DateNP } = require("datenp");

AD to BS

import DateNP from "datenp"

const np = new DateNP(new Date("2022-01-06"));

console.log(np.toBS()); // { year: 2078, month: 9, day: 22 }

BS to AD

import DateNP from "datenp"

const np = new DateNP("2078-09-22");

console.log(np.toAD()); // { year: 2022, month: 1, day: 6 }
console.log(np.getMonthName()); // "Poush"

Created and maintained by DevAndromeda

Under MIT License

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    1
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i datenp

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

172 kB

Total Files

8

Last publish

Collaborators

  • snowflake7