mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Improved date display of "Track date only"-chores (never show the time part for them)
This commit is contained in:
parent
a4454f825a
commit
26ebeec74f
@ -301,7 +301,7 @@ RefreshContextualTimeago = function()
|
|||||||
var timestamp = element.attr("datetime");
|
var timestamp = element.attr("datetime");
|
||||||
|
|
||||||
var isNever = timestamp && timestamp.substring(0, 10) == "2999-12-31";
|
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");
|
var isToday = timestamp && timestamp.substring(0, 10) == moment().format("YYYY-MM-DD");
|
||||||
var isDateWithoutTime = element.hasClass("timeago-date-only");
|
var isDateWithoutTime = element.hasClass("timeago-date-only");
|
||||||
|
|
||||||
if (isNever)
|
if (isNever)
|
||||||
|
@ -116,8 +116,13 @@ $(document).on('click', '.track-chore-button', function(e)
|
|||||||
|
|
||||||
Grocy.FrontendHelpers.EndUiBusy();
|
Grocy.FrontendHelpers.EndUiBusy();
|
||||||
toastr.success(__t('Tracked execution of chore %1$s on %2$s', choreName, trackedTime));
|
toastr.success(__t('Tracked execution of chore %1$s on %2$s', choreName, trackedTime));
|
||||||
RefreshContextualTimeago();
|
|
||||||
RefreshStatistics();
|
RefreshStatistics();
|
||||||
|
|
||||||
|
// Delay due to delayed/animated set of new timestamps above
|
||||||
|
setTimeout(function()
|
||||||
|
{
|
||||||
|
RefreshContextualTimeago();
|
||||||
|
}, 550);
|
||||||
},
|
},
|
||||||
function(xhr)
|
function(xhr)
|
||||||
{
|
{
|
||||||
|
@ -14,6 +14,15 @@ Grocy.Components.ChoreCard.Refresh = function(choreId)
|
|||||||
$('#chorecard-chore-edit-button').attr("href", U("/chore/" + choreDetails.chore.id.toString()));
|
$('#chorecard-chore-edit-button').attr("href", U("/chore/" + choreDetails.chore.id.toString()));
|
||||||
$('#chorecard-chore-edit-button').removeClass("disabled");
|
$('#chorecard-chore-edit-button').removeClass("disabled");
|
||||||
|
|
||||||
|
if (choreDetails.chore.track_date_only == 1)
|
||||||
|
{
|
||||||
|
$("#chorecard-chore-last-tracked-timeago").addClass("timeago-date-only");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#chorecard-chore-last-tracked-timeago").removeClass("timeago-date-only");
|
||||||
|
}
|
||||||
|
|
||||||
EmptyElementWhenMatches('#chorecard-chore-last-tracked-timeago', __t('timeago_nan'));
|
EmptyElementWhenMatches('#chorecard-chore-last-tracked-timeago', __t('timeago_nan'));
|
||||||
RefreshContextualTimeago();
|
RefreshContextualTimeago();
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user