@magmacomputing/tempo-plugin-finance
A specialized namespace plugin for Tempo that provides fiscal year and financial date utilities.
Key Features
- Namespaced API: All utilities are grouped under
t.finance. - Fiscal Calendar Properties: Read
t.finance.fiscalQuarterandt.finance.taxYeardirectly from anyTempoinstance. - Boundary Helpers:
t.finance.isFiscalYearStart()flags fiscal year boundaries.
Installation
bash
npm install @magmacomputing/tempo-plugin-financeQuickstart
Interactive Demo (@magmacomputing/tempo-plugin-finance)
Open in Full REPL↗// 💼 Fiscal & Financial Math Demo (@magmacomputing/tempo-plugin-finance)
const { FinanceNamespace } = await import('@magmacomputing/tempo-plugin-finance');
Tempo.use(FinanceNamespace);
const t = new Tempo('2026-07-15');
console.log('Fiscal Quarter:', t.finance.fiscalQuarter);
console.log('Tax Year:', t.finance.taxYear);
console.log('Is Fiscal Year Start?', t.finance.isFiscalYearStart());
return `Fiscal Q${t.finance.fiscalQuarter} (Tax Year ${t.finance.taxYear})`;typescript
import { Tempo } from '@magmacomputing/tempo';
import { FinanceNamespace } from '@magmacomputing/tempo-plugin-finance';
// Register the namespace
Tempo.use(FinanceNamespace);
const t = new Tempo('2024-07-01');
// Evaluate static properties
console.log(t.finance.fiscalQuarter); // 3
console.log(t.finance.taxYear); // 2024
// Evaluate functional closures
console.log(t.finance.isFiscalYearStart()); // falseAuto-Installation (Side-Effect Import)
For zero-boilerplate global registration, import the /install subpath:
typescript
import { Tempo } from '@magmacomputing/tempo';
import '@magmacomputing/tempo-plugin-finance/install';
const t = new Tempo('2024-07-01');
console.log(t.finance.fiscalQuarter); // 3License
This is a Community plugin. It is completely free and open-source for personal and commercial use under the MIT license.