Nepali DateNepali DateBikram Sambat Date Engine
Fiscal Year & Quarters

NepaliDate.getCurrentFiscalYear()

Method to retrieve the formatted fiscal year string for a given NepaliDate instance.

The getCurrentFiscalYear method determines which official Nepalese fiscal year contains the current date instance. It returns a standardized fiscal year string such as 2081/82 based on whether the date falls before or after the 1 Shrawan fiscal transition boundary.


Import

import { NepaliDate } from "nepali-date-library";
const { NepaliDate } = require("nepali-date-library");

Signature

static getCurrentFiscalYear(): number;

Parameters

  • None.

Return Value

  • Type: number
  • Description: The 4-digit Bikram Sambat year representing the beginning of the active fiscal cycle.

Behavioral Logic

The method determines the current date and evaluates the month:

  • If current month is Baisakh, Jestha, or Ashadh (months 0, 1, or 2), the fiscal cycle began in the previous calendar year. Returns currentYear - 1.
  • If current month is Shrawan through Chaitra (months 3 through 11), the fiscal cycle began in the current calendar year. Returns currentYear.

Examples

Getting Current Fiscal Year Integer

import { NepaliDate } from "nepali-date-library";

// If today is 2081 Kartik 15:
const fy = NepaliDate.getCurrentFiscalYear();
console.log(fy); // 2081

Generating Formatted Fiscal Strings

import { NepaliDate } from "nepali-date-library";

function getFormattedFiscalYear(): string {
  const fy = NepaliDate.getCurrentFiscalYear();
  const nextShort = String(fy + 1).slice(-2);
  return `${fy}/${nextShort}`; // e.g. "2081/82"
}

console.log(getFormattedFiscalYear()); // "2081/82"

Invoice Number Prefixing

import { NepaliDate } from "nepali-date-library";

function generateInvoiceNumber(sequence: number): string {
  const fy = NepaliDate.getCurrentFiscalYear();
  const fyTag = `${String(fy).slice(-2)}${String(fy + 1).slice(-2)}`; // "8182"
  const paddedSeq = String(sequence).padStart(5, "0");
  return `INV-${fyTag}-${paddedSeq}`;
}

console.log(generateInvoiceNumber(42)); // "INV-8182-00042"

Advertisement

On this page