Skip to content

Releases: twlite/datenp

v0.1.2

08 Jan 19:41
Compare
Choose a tag to compare

Updates

  • toJSON now returns object containing AD and BS dates

Full Changelog: 0.1.1...0.1.2

v0.1.1

06 Jan 16:26
Compare
Choose a tag to compare

Updates

  • add isLeapYear(year?: number): boolean

Full Changelog: 0.1.0...0.1.1

v0.1.0

06 Jan 16:17
Compare
Choose a tag to compare

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";

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"

Full Changelog: https://github.com/DevAndromeda/datenp/commits/0.1.0