Fiscal Year & Quarters
date.getCurrentFiscalYearQuarterDates()
Method to retrieve exact start and end boundary dates for the active fiscal quarter.
The getCurrentFiscalYearQuarterDates method computes the exact starting date and ending date for the fiscal quarter containing the current date instance. It returns an object containing boundary dates as new NepaliDate objects, which is helpful for quarterly financial reporting, audit periods, and tax filing windows.
Import
import { NepaliDate } from "nepali-date-library";const { NepaliDate } = require("nepali-date-library");Signature
getCurrentFiscalYearQuarterDates(): { start: NepaliDate; end: NepaliDate };Parameters
- None.
Return Value
- Type:
{ start: NepaliDate; end: NepaliDate } - Structure:
start:NepaliDateinstance pointing to the first day of the quarter at00:00:00.000.end:NepaliDateinstance pointing to the final day of the quarter at23:59:59.999.
Examples
Getting Current Quarter Boundaries
import { NepaliDate } from "nepali-date-library";
// Assuming today is 2081 Kartik 15 (Q2):
const today = new NepaliDate();
const { start, end } = today.getCurrentFiscalYearQuarterDates();
console.log(start.format("YYYY-MM-DD")); // "2081-07-01" (1 Kartik)
console.log(end.format("YYYY-MM-DD")); // "2081-09-30" (Last day of Poush)Database Query Boundary Filter
import { NepaliDate } from "nepali-date-library";
function getActiveQuarterFilter() {
const now = new NepaliDate();
const { start, end } = now.getCurrentFiscalYearQuarterDates();
return {
startGregorian: start.getEnglishDate(),
endGregorian: end.getEnglishDate(),
quarterIndex: now.getCurrentFiscalYearQuarter(),
};
}Related
NepaliDate.getFiscalYearQuarter(): Static helper accepting an explicit quarter index.NepaliDate.getFiscalYearQuarters(): Retrieve all 4 quarters in one object.
Advertisement
date.getCurrentFiscalYearQuarter()
Method to calculate the active fiscal trimester quarter number for a NepaliDate instance.
NepaliDate.getFiscalYearQuarter()
Static method to determine the fiscal trimester number for any specified month index.