Nepali DateNepali DateBikram Sambat Date Engine
Fiscal Year & Quarters

NepaliDate.getFiscalYearQuarter()

Static method to determine the fiscal trimester number for any specified month index.

The static getFiscalYearQuarter method determines the fiscal trimester number corresponding to a given Bikram Sambat month index from 0 to 11. It allows quick lookups without needing to instantiate a full NepaliDate object, making it useful in financial aggregation pipelines and reporting utilities.


Import

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

Signature

static getFiscalYearQuarter(
  quarter: number,
  fiscalYear?: number
): { start: NepaliDate; end: NepaliDate };

Parameters

ParameterTypeRequiredDefaultDescription
quarternumberYes-Fiscal quarter index (1, 2, 3, or 4).
fiscalYearnumberNoCurrent FYBase Bikram Sambat year of the fiscal cycle.

Return Value

  • Type: { start: NepaliDate; end: NepaliDate }
  • Properties:
    • start: NepaliDate initialized to day 1 of the quarter's opening month.
    • end: NepaliDate initialized to the final day of the quarter's closing month at 23:59:59.999.

Exceptions

Error MessageTrigger Condition
Quarter must be an integer between 1 and 4Thrown if quarter is not an integer or is outside 1 to 4.

Examples

Querying Specific Quarter for Current Fiscal Year

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

// Get Q1 of the current fiscal year
const q1 = NepaliDate.getFiscalYearQuarter(1);
console.log(q1.start.format("YYYY-MM-DD")); // "2081-04-01" (1 Shrawan)
console.log(q1.end.format("YYYY-MM-DD"));   // "2081-06-30" (End of Ashwin)

Querying Cross-Year Quarter (Q4)

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

// Q4 of FY 2080/81 takes place in calendar year 2081
const q4 = NepaliDate.getFiscalYearQuarter(4, 2080);
console.log(q4.start.format("YYYY-MM-DD")); // "2081-01-01" (1 Baisakh 2081)
console.log(q4.end.format("YYYY-MM-DD"));   // "2081-03-31" (End of Ashadh 2081)

Advertisement

On this page