Skip to content

A simple tiny (806 Bytes) Javascript plugin that uses that format date '* days ago'.

License

Notifications You must be signed in to change notification settings

Titanium2099/timeago

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

timeago

A simple JS plugin that uses that format date '* days ago'.

Usage

First, load the plugin:

<script src="https://raw.githubusercontent.com/Titanium2099/timeago/main/timeago.min.js"></script>

then create a new timeago object:

var ta = new timeago();
console.log(ta.timeago(Date.now()));

Yep, its that easy!

Output patterns

  • about a **** ago EG: about an hour ago
  • about * *** ago EG: about 5 hours ago
  • today at : (am/pm) EG: today at 5:47pm
  • right now

License

Licensed under the MIT License.