hardlounge/client/js/libs/handlebars/friendlydate.js
Jérémie Astori 648cfd12db Use moment on the client to display friendly dates
Also, unread and date markers are now half-transparent based on their colors and not parent opacity. This is necessary to display a non-translucide tooltip.
2017-04-22 00:38:19 -04: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(new Date(time)).calendar(null, {
sameDay: "[Today]",
lastDay: "[Yesterday]",
lastWeek: "L", // Locale
sameElse: "L"
});
};