pure-age-calculator
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Introduction

JavaScript Library to calculate age 年齢計算を行うJavaScriptのライブラリです

Installation

npm i pure-age-calculator
or
yarn add pure-age-calculator
or
pnpm add pure-age-calculator

Usage

example1

const from = new Date('1991-10-15');
const to = new Date('2022-11-15');

const result = getAgePure(from,to);
/*
result = {
  years: 31,
  months: 373,
  days: 11354
}
*/

example2

const from = new Date('1991-10-15');
const to = new Date('2022-11-15');
const format:UnitType = 'years';
const result = getAgePureFormat(from,to, format);
/*
  result = 31
*/

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    10
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    10
  • 1.0.2
    13
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i pure-age-calculator

Weekly Downloads

23

Version

1.0.3

License

MIT

Unpacked Size

34.7 kB

Total Files

18

Last publish

Collaborators

  • yuumillar