Skip to content

Files

Latest commit

 

History

History
32 lines (17 loc) · 586 Bytes

README.md

File metadata and controls

32 lines (17 loc) · 586 Bytes

momentary.js

minimal "timeago" style javascript library

Example usage

Momentary.fromNow(datestring);

Output: now, 1m, 2h, 4d, for dates older than 1 month it will write the date as DD\MM\YYYY

Momentary.fromNow(datestring, locale);

Set the locale (e.g. "en-us", "en-GB" to change the format of the full date), default is "en-GB"

Momentary.fromNow(datestring, locale, options);

Add date formatting options, default is {year: 'numeric', month: 'numeric', day: 'numeric'}

CDN

https://cdn.jsdelivr.net/gh/wolfha/momentary/dist/momentary.min.js