Improved date display for dates of today and no time

Instead of the hours since midnight now just "Today" will be shown
This commit is contained in:
Bernd Bestel
2019-07-06 17:19:28 +02:00
parent df529c3c0b
commit c6c10c87e4
7 changed files with 18 additions and 5 deletions

View File

@@ -300,10 +300,15 @@ RefreshContextualTimeago = function()
var element = $(this);
var timestamp = element.attr("datetime");
var isNever = timestamp && timestamp.substring(0, 10) == "2999-12-31";
var isToday = timestamp && timestamp.length == 10 && timestamp.substring(0, 10) == moment().format("YYYY-MM-DD");
if (isNever)
{
element.prev().text(__t("Never"));
}
if (isToday)
{
element.text(__t("Today"));
}
else
{
element.timeago("update", timestamp);