Skip to content

SaurabPoudel/nepali-date

Repository files navigation

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.

About

a jsr library for Nepali dates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published