
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Calculate the difference between two dates based on the 360 day financial year
Calculate the difference between two dates based on the 360 day financial year, using the US/NASD method (30US/360) or European method (30E/360).
Excel's implementation of the US/NASD method has an incorrect implementation. This library provides an Excel compatible US/NASD method.
const days360 = require('days360');
days360(new Date('2016-01-01'), new Date('2016-12-31')); // returns 360
startDate
: Start date, as a date or milliseconds since Unix epochendDate
: End date, as a Date or milliseconds since Unix epochmethod
: An optional argument to specify the calculation
days360.US
(0
): calculate using the US/NASD method, with Excel compatibilitydays360.EU
(1
): calculate using the European methoddays360.US_NASD
(2
): calculate using the US/NASD methodTests require Mocha and can be run with npm test
(or yarn test
). You can specify Mocha options, such as the reporter, by adding a mocha.opts file to the test
directory.
Running npm run test:coverage
will generate code coverage reports with Istanbul. The code coverage reports will be located in the coverage
directory, which is excluded from the repository.
2.0.0 (2018-08-28)
FAQs
Calculate the difference between two dates based on the 360 day financial year
The npm package days360 receives a total of 1,430 weekly downloads. As such, days360 popularity was classified as popular.
We found that days360 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.