diff --git a/client/css/style.css b/client/css/style.css index d74baf61..23e2e5a5 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -841,7 +841,6 @@ kbd { #chat .unread-marker { position: relative; text-align: center; - opacity: .5; margin: 0 10px; z-index: 0; font-weight: bold; @@ -855,13 +854,13 @@ kbd { left: 0; right: 0; top: 50%; - border-top: 1px solid #e74c3c; + border-top: 1px solid rgba(231, 76, 60, .5); } #chat .unread-marker-text:before { content: "New messages"; background-color: white; - color: #e74c3c; + color: rgba(231, 76, 60, .5); padding: 0 10px; } @@ -872,7 +871,6 @@ kbd { #chat .date-marker { position: relative; text-align: center; - opacity: .5; margin: 0 10px; z-index: 0; font-weight: bold; @@ -886,13 +884,13 @@ kbd { left: 0; right: 0; top: 50%; - border-top: 1px solid #006b3b; + border-top: 1px solid rgba(0, 107, 59, .5); } #chat .date-marker-text:before { - content: attr(data-date); + content: attr(data-label); background-color: white; - color: #006b3b; + color: rgba(0, 107, 59, .5); padding: 0 10px; } diff --git a/client/js/libs/handlebars/friendlydate.js b/client/js/libs/handlebars/friendlydate.js new file mode 100644 index 00000000..92e81080 --- /dev/null +++ b/client/js/libs/handlebars/friendlydate.js @@ -0,0 +1,13 @@ +"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" + }); +}; diff --git a/client/themes/morning.css b/client/themes/morning.css index 9698330c..d5ca62e9 100644 --- a/client/themes/morning.css +++ b/client/themes/morning.css @@ -155,11 +155,6 @@ body { border-color: #333c4a; } -#chat .unread-marker, -#chat .date-marker { - opacity: 1; -} - #chat .unread-marker-text:before { background-color: #333c4a; } diff --git a/client/themes/zenburn.css b/client/themes/zenburn.css index 2c075412..b4abd4ed 100644 --- a/client/themes/zenburn.css +++ b/client/themes/zenburn.css @@ -181,11 +181,6 @@ body { border-color: #3f3f3f; } -#chat .unread-marker, -.date-marker { - opacity: 1; -} - #chat .unread-marker-text:before { background-color: #3f3f3f; } diff --git a/client/views/date-marker.tpl b/client/views/date-marker.tpl index bf9d89c7..3e5ec60d 100644 --- a/client/views/date-marker.tpl +++ b/client/views/date-marker.tpl @@ -1,3 +1,5 @@ -