mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Optimized tracking button handling on /choresoverview (closes #2186)
This commit is contained in:
@@ -93,19 +93,20 @@ $(document).on('click', '.track-chore-button', function(e)
|
||||
var choreId = $(e.currentTarget).attr('data-chore-id');
|
||||
var choreName = $(e.currentTarget).attr('data-chore-name');
|
||||
var skipped = $(e.currentTarget).hasClass("skip");
|
||||
var now = $(e.currentTarget).hasClass("now");
|
||||
|
||||
Grocy.Api.Get('chores/' + choreId,
|
||||
function(choreDetails)
|
||||
{
|
||||
var trackedTime = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||
if (skipped)
|
||||
if ((skipped || !now) && choreDetails.next_estimated_execution_time != null)
|
||||
{
|
||||
trackedTime = moment(choreDetails.next_estimated_execution_time).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
if (choreDetails.chore.track_date_only == 1)
|
||||
{
|
||||
if (skipped)
|
||||
if ((skipped || !now) && choreDetails.next_estimated_execution_time != null)
|
||||
{
|
||||
trackedTime = moment(choreDetails.next_estimated_execution_time).format('YYYY-MM-DD');
|
||||
}
|
||||
|
Reference in New Issue
Block a user