Code Monkey home page Code Monkey logo

time_ago_in_words's Introduction

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.

Parameters Type Description Example
date Date string

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.

time_ago_in_words's People

Contributors

jojitoon avatar iyikuyoro avatar

Stargazers

Adebanjo oluwatominiyin avatar  avatar Inumidun Amao avatar Jude avatar

Watchers

James Cloos avatar

Forkers

iyikuyoro

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.