mirror of
https://github.com/grocy/grocy.git
synced 2026-03-28 07:39:25 +01:00
Fixed chore skip handling via /choresoverview (references #1830)
This commit is contained in:
parent
5dc745f301
commit
9db66048d1
|
|
@ -94,13 +94,25 @@ $(document).on('click', '.track-chore-button', function(e)
|
|||
var choreName = $(e.currentTarget).attr('data-chore-name');
|
||||
var skipped = $(e.currentTarget).hasClass("skip");
|
||||
|
||||
Grocy.Api.Get('objects/chores/' + choreId,
|
||||
function(chore)
|
||||
Grocy.Api.Get('chores/' + choreId,
|
||||
function(choreDetails)
|
||||
{
|
||||
var trackedTime = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||
if (chore.track_date_only == 1)
|
||||
if (skipped)
|
||||
{
|
||||
trackedTime = moment().format('YYYY-MM-DD');
|
||||
trackedTime = moment(choreDetails.next_estimated_execution_time).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
if (choreDetails.chore.track_date_only == 1)
|
||||
{
|
||||
if (skipped)
|
||||
{
|
||||
trackedTime = moment(choreDetails.next_estimated_execution_time).format('YYYY-MM-DD');
|
||||
}
|
||||
else
|
||||
{
|
||||
trackedTime = moment().format('YYYY-MM-DD');
|
||||
}
|
||||
}
|
||||
|
||||
Grocy.Api.Post('chores/' + choreId + '/execute', { 'tracked_time': trackedTime, 'skipped': skipped },
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user