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
*/

Readme

Keywords

none

Package Sidebar

Install

npm i pure-age-calculator

Weekly Downloads

13

Version

1.0.3

License

MIT

Unpacked Size

34.7 kB

Total Files

18

Last publish

Collaborators

  • yuumillar