mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 08:05:19 +00:00
16 lines
300 B
JavaScript
16 lines
300 B
JavaScript
var moment = require('moment');
|
|
|
|
|
|
module.exports = {
|
|
// Format a date
|
|
// ex: 'MMMM Do YYYY, h:mm:ss a
|
|
date: function(time, format) {
|
|
return moment(time).format(format);
|
|
},
|
|
|
|
// Relative Time
|
|
dateFromNow: function(time) {
|
|
return moment(time).fromNow();
|
|
}
|
|
};
|