Fiscal Year & Quarters
NepaliDate.getFiscalYearQuarters()
Static utility returning all four fiscal trimesters with their constituent months and date ranges for a given year.
The static getFiscalYearQuarters method returns a complete structural breakdown of all four fiscal trimesters for a specified Bikram Sambat year. Each quarter entry includes its trimester index, English and Nepali month names, and corresponding calendar boundary information.
Import
import { NepaliDate } from "nepali-date-library";const { NepaliDate } = require("nepali-date-library");Signature
static getFiscalYearQuarters(fiscalYear?: number): {
Q1: { start: NepaliDate; end: NepaliDate };
Q2: { start: NepaliDate; end: NepaliDate };
Q3: { start: NepaliDate; end: NepaliDate };
Q4: { start: NepaliDate; end: NepaliDate };
};Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
fiscalYear | number | No | Current FY | Base Bikram Sambat year of the fiscal cycle (e.g. 2081). |
Return Value
- Type: An object with keys
Q1,Q2,Q3, andQ4. - Structure:
Q1: 1 Shrawan – Last day of AshwinQ2: 1 Kartik – Last day of PoushQ3: 1 Magh – Last day of ChaitraQ4: 1 Baisakh – Last day of Ashadh (in succeeding calendar year)
Examples
Getting Current Fiscal Year Quarters
import { NepaliDate } from "nepali-date-library";
const quarters = NepaliDate.getFiscalYearQuarters();
console.log("Q1 Start:", quarters.Q1.start.format("YYYY-MM-DD")); // 2081-04-01
console.log("Q1 End: ", quarters.Q1.end.format("YYYY-MM-DD")); // 2081-06-30
console.log("Q2 Start:", quarters.Q2.start.format("YYYY-MM-DD")); // 2081-07-01
console.log("Q2 End: ", quarters.Q2.end.format("YYYY-MM-DD")); // 2081-09-30
console.log("Q3 Start:", quarters.Q3.start.format("YYYY-MM-DD")); // 2081-10-01
console.log("Q3 End: ", quarters.Q3.end.format("YYYY-MM-DD")); // 2081-12-30
console.log("Q4 Start:", quarters.Q4.start.format("YYYY-MM-DD")); // 2082-01-01
console.log("Q4 End: ", quarters.Q4.end.format("YYYY-MM-DD")); // 2082-03-31Iterating for Financial Charts
import { NepaliDate } from "nepali-date-library";
const quarters = NepaliDate.getFiscalYearQuarters(2080);
const quarterList = Object.entries(quarters).map(([quarterName, dates]) => ({
quarter: quarterName,
startDateBS: dates.start.format("YYYY-MM-DD"),
endDateBS: dates.end.format("YYYY-MM-DD"),
startDateAD: dates.start.getEnglishDate().toISOString().split("T")[0],
endDateAD: dates.end.getEnglishDate().toISOString().split("T")[0],
}));
console.log(quarterList);Related
NepaliDate.getFiscalYearQuarter(): Retrieve a single quarter.Calendar Quarters: Standard calendar quarters aligned with Baisakh.
Advertisement
NepaliDate.getFiscalYearQuarter()
Static method to determine the fiscal trimester number for any specified month index.
Calendar Quarters
Explanation of standard Bikram Sambat calendar quarters compared to government fiscal trimesters.