Skip to content

Fiscal tax year calculator, retrieve the tax-year, month and week for a given date. Start date of the financial year is editable.

License

Notifications You must be signed in to change notification settings

Antoine-Mace/tax-year

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Download

Tax Year

Fiscal tax year calculator, retrieve the tax-year, month and week for a given date.

Quick start

Install onto your node project using yarn or npm:

yarn add tax-year
npm install tax-year

To use:

'use strict'

const taxYear = require('tax-year')

const today = new Date()
const calculator = taxYear()

function runCalendarTest() {
  let computeDate = today;
  let days = 1;
  console.log("\nTest 3/3: Uk, 1 year")
  while (days != 365) {
    let result =  calculator.getTaxYear(computeDate);
    console.log(`\n${days + 1}/365`)
    console.log("Result:", result)
    computeDate.setDate(computeDate.getDate() + 1);
    days++;
  }
}


function runTest() {
  console.log("Test 1/3: Irish, financial year start")
  console.log("Result:", calculator.getTaxYear(today, {
    day: 1,
    month: 1
  }))
  console.log("\nTest 2/3: Uk, financial year start")
  calculator.setFYS({
    day: 6,
    month: 4
  })
  console.log("Result:", calculator.getTaxYear(today))
  runCalendarTest(calculator)
}

runTest()

Test

yarn test
npm run test

License

This project is MIT licensed. By contributing you agree that your contributions will be licensed under its MIT license.

About

Fiscal tax year calculator, retrieve the tax-year, month and week for a given date. Start date of the financial year is editable.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published