mirror of
https://github.com/grocy/grocy.git
synced 2025-08-13 01:06:23 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user