Nepali DateNepali DateBikram Sambat Date Engine
Fiscal Year & Quarters

date.getCurrentFiscalYearQuarter()

Method to calculate the active fiscal trimester quarter number for a NepaliDate instance.

The getCurrentFiscalYearQuarter method returns an integer from 1 to 4 representing the active fiscal trimester of the current date. Because Nepal fiscal calendar starts in Shrawan, quarter 1 covers Shrawan through Ashwin, quarter 2 spans Kartik through Poush, quarter 3 covers Magh through Chaitra, and quarter 4 spans Baisakh through Ashadh.


Import

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

Signature

getCurrentFiscalYearQuarter(): number;

Parameters

  • None.

Return Value

  • Type: number
  • Values: 1 | 2 | 3 | 4
Month (Bikram Sambat)Month IndexReturned Quarter
Shrawan, Bhadra, Ashwin3, 4, 51 (Q1)
Kartik, Mangsir, Poush6, 7, 82 (Q2)
Magh, Falgun, Chaitra9, 10, 113 (Q3)
Baisakh, Jestha, Ashadh0, 1, 24 (Q4)

Examples

Determining Quarter of a Given Date

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

const dashainDate = new NepaliDate("2081-07-15"); // Kartik
console.log(dashainDate.getCurrentFiscalYearQuarter()); // 2 (Q2)

const endOfYearDate = new NepaliDate("2081-03-25"); // Ashadh
console.log(endOfYearDate.getCurrentFiscalYearQuarter()); // 4 (Q4)

Financial Audit Filter

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

interface JournalEntry {
  description: string;
  date: NepaliDate;
  amount: number;
}

function filterByFiscalQuarter(entries: JournalEntry[], targetQuarter: number) {
  return entries.filter(
    (entry) => entry.date.getCurrentFiscalYearQuarter() === targetQuarter
  );
}

Advertisement

On this page