hardlounge/client/js/libs/handlebars/friendlydate.js
2017-05-01 21:31:31 +03:00

14 lines
292 B
JavaScript

"use strict";
const moment = require("moment");
module.exports = function(time) {
// See http://momentjs.com/docs/#/displaying/calendar-time/
return moment(time).calendar(null, {
sameDay: "[Today]",
lastDay: "[Yesterday]",
lastWeek: "D MMMM YYYY",
sameElse: "D MMMM YYYY"
});
};