Skip to content

alexander-daniel/simple-timeago

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-timeago Build Status

Create simple human-readable fuzzy-timestamps

example

var timeAgo = require('simple-timeago');

var startTime = new Date();
var thirtyOneMinutesAgo = new Date(startTime - 1.86e+6);

console.log(timeAgo(thirtyOneMinutesAgo));
// 31 minutes ago

methods

var timeAgo = require('simple-timeago');

timeAgo(since, until)

  • since - Date object to calculate time-since from.
  • until - Date object to calculate time-since to. (Optional, defaults to now (new Date()))

Returns a string of fuzzy time.

install

npm install simple-timeago

test

npm test

license

MIT

About

Create simple human-readable fuzzy-timestamps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published