Skip to content

API Reference

This section provides complete documentation for all classes, functions, and constants exported by the Nepali Date Library.

Main Exports

Classes

ClassDescription
NepaliDateMain class for working with Nepali dates

Functions

FunctionDescription
ADtoBSConvert AD (Gregorian) date to BS (Nepali)
BStoADConvert BS (Nepali) date to AD (Gregorian)

Constants

ConstantDescription
MONTH_ENEnglish month names
MONTH_NPNepali month names
MONTH_SHORT_ENShort English month names
MONTH_SHORT_NPShort Nepali month names
WEEK_ENEnglish weekday names
WEEK_NPNepali weekday names
WEEK_SHORT_ENShort English weekday names
WEEK_SHORT_NPShort Nepali weekday names
NUMBER_NPNepali digits (०-९)
NEPALI_DATE_MAPComplete date map for BS 2000-2100

Quick Import

typescript
import {
  // Main class
  NepaliDate,

  // Conversion functions
  ADtoBS,
  BStoAD,

  // Month constants
  MONTH_EN,
  MONTH_NP,
  MONTH_SHORT_EN,
  MONTH_SHORT_NP,

  // Week constants
  WEEK_EN,
  WEEK_NP,
  WEEK_SHORT_EN,
  WEEK_SHORT_NP,

  // Other constants
  NUMBER_NP,
  NEPALI_DATE_MAP,
} from "nepali-date-library";

Released under the MIT License.