hours-text

1.3.0 • Public • Published

hours-text Formatter

International Written Hours To XXX Time-Ago Farmat.

Farmated Hours Showing like bellow:

1 hour ago
1 day ago
1 week ago
18 November, 2015
etc ..........

Installation

npm install hours-text

Usage

var  hourstext = require('hours-text');

var farmatdate = hourstext(1); 
console.log(farmatdate); // 1 hour ago


var farmatdate = hourstext(25); 
console.log(farmatdate); // 1 day ago

var farmatdate = hourstext(168); 
console.log(farmatdate); //  1 week ago

 var farmatdate = hourstext(5000); //On 13th Jun 2016
 console.log(farmatdate); //  18 November, 2015

Tests

npm test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Package Sidebar

Install

npm i hours-text

Weekly Downloads

4

Version

1.3.0

License

ISC

Last publish

Collaborators

  • rajathavalam