Skip to main content
Home

Built and signed on GitHub Actions

Nepali date package that validates, format and compare nepali dates

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
7 months ago (0.1.3)

Nepali Date Library

A comprehensive Nepali date manipulation library for Deno. This library provides utilities for working with Nepali (Bikram Sambat) dates, including formatting, conversion, and date arithmetic.

Tags License

Features

  • Format Nepali dates with various patterns
  • Convert between Nepali and Gregorian dates
  • Date arithmetic operations
  • Supports both English and Nepali languages
  • Zero dependencies
  • Tree-shakeable exports
  • Type-safe with TypeScript

Usage

Format Nepali Date

import { formatNepaliDate } from "@saurab/nepali-date";

console.log(formatNepaliDate(2071, 1, 30));
// returns "२०७१-०१-३०"

Validate Nepali Date

import { validateNepaliDate } from "@saurab/nepali-date";

validateNepaliDate(2071, 1, 222); // throws error if date is invalid

Compare Nepali Dates

import { compareNepaliDates } from "@saurab/nepali-date";

compareNepaliDates(2071, 1, 20, 2071, 1, 30); // return -10

License

This project is licensed under the MIT License - see the LICENSE file for details.

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@saurab/nepali-date

Import symbol

import * as nepali_date from "@saurab/nepali-date";
or

Import directly with a jsr specifier

import * as nepali_date from "jsr:@saurab/nepali-date";

Add Package

pnpm i jsr:@saurab/nepali-date
or (using pnpm 10.8 or older)
pnpm dlx jsr add @saurab/nepali-date

Import symbol

import * as nepali_date from "@saurab/nepali-date";

Add Package

yarn add jsr:@saurab/nepali-date
or (using Yarn 4.8 or older)
yarn dlx jsr add @saurab/nepali-date

Import symbol

import * as nepali_date from "@saurab/nepali-date";

Add Package

vlt install jsr:@saurab/nepali-date

Import symbol

import * as nepali_date from "@saurab/nepali-date";

Add Package

npx jsr add @saurab/nepali-date

Import symbol

import * as nepali_date from "@saurab/nepali-date";

Add Package

bunx jsr add @saurab/nepali-date

Import symbol

import * as nepali_date from "@saurab/nepali-date";