Ago
Ago
is a simple tool for calculating how long ago a date was.
var Ago = ; var ago = date: "1993/10/15 09:05:10 pm" lang: 'en-US' hourFormat: 12; ago; // => October 15th 1993 09:05:10 pmago; // => October 15th 1993ago; // => 09:05:10 pmago; // => 2 decades ago // (2 decades ago from 2015)
API
Ago(options)
The constructor.
var Ago = ; // This are the only three options.var options = date: "1993/10/15 09:05:10 pm" // date to work with. lang: 'en-US' // language to use. hourFormat: 12 // hour format 24 or 12; var ago = options;
Ago.getFullDate()
This method returns a string with the full date.
ago; // => October 15th 1993 09:05:10 pm
Ago.getDate()
This method returns a string just with the date.
ago; // => October 15th 1993
Ago.getTime()
This method returns a string just with the time.
ago; // => 09:05:10 pm
Ago.ago()
This method returns a string telling how long ago was a date.
ago; // => 2 decades ago // (2 decades ago from 2015)
Ago.toString()
Same as Ago.ago().
ago; // => 2 decades agoago + ""; // => 2 decades ago // (2 decades ago from 2015)
Ago.setLanguage(language)
// TODO: Add documentation
Ago.getLanguage()
// TODO: Add documentation
Ago.setHourFormat(format)
// TODO: Add documentation
Ago.getHourFormat()
// TODO: Add documentation
Ago.loadCustomLanguages(languages)
// TODO: Add documentation
LICENSE
MIT