2.0.1 • Published 5 years ago

time_past v2.0.1

Weekly downloads
12
License
MIT
Repository
github
Last release
5 years ago

Time_Past Build Status Maintainability Test Coverage

Time past is a simple package that helps compute the time that has elapsed since a particular date. It converts dates to elapsed time.

It can be headache to write all that code that computes the time that has passed since the current date, hence this package.

Current Features

  1. Compute time elapsed from specific date till now.

Intended Features

  1. Compute time elapsed between two dates.

Get Started

  • Simply download the package as a development dependency with npm i time_past.
  • Import and use

import TimePast from 'time_past';

function() {
  const date = '2012-10-10'

  const elapsedTime = TimePast.inWords(data);
  console.log(elapsedTime); // '7 years ago'
}

Documentation

Methods

inWords: This method computes the elapsed time from a previous date till now. The previous date can either be a string or a Javascript Date object. Returned value will be a string.

ParametersTypeDescriptionExample
dateDatestringThe previous date'2012-10-10'

Example (inWords)

const elapsedTime = TimePast.inWords(
  '2012-10-10',
);

console.log(elapsedTime); // '7 years ago'

Contributors

Jojitoon: 👨🏿Profile Opeoluwa Iyi-Kuyoro: 👨🏿Profile - WebSite

Contributions

PR Style: Please use the template you find in the PR message to compose one.

2.0.1

5 years ago

2.0.0

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago