mirror of
https://github.com/grocy/grocy.git
synced 2025-10-14 01:04:01 +00:00
Make it possible to track a chore execution without the time part, only the day
This commit is contained in:
@@ -45,6 +45,26 @@ $('#chore_id').on('change', function(e)
|
||||
var choreId = $(e.target).val();
|
||||
if (choreId)
|
||||
{
|
||||
Grocy.Api.Get('objects/chores/' + choreId,
|
||||
function(chore)
|
||||
{
|
||||
if (chore.track_date_only == 1)
|
||||
{
|
||||
Grocy.Components.DateTimePicker.ChangeFormat("YYYY-MM-DD");
|
||||
Grocy.Components.DateTimePicker.SetValue(moment().format("YYYY-MM-DD"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Grocy.Components.DateTimePicker.ChangeFormat("YYYY-MM-DD HH:mm:ss");
|
||||
Grocy.Components.DateTimePicker.SetValue(moment().format("YYYY-MM-DD HH:mm:ss"));
|
||||
}
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
|
||||
Grocy.Components.ChoreCard.Refresh(choreId);
|
||||
Grocy.Components.DateTimePicker.GetInputElement().focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('choretracking-form');
|
||||
|
Reference in New Issue
Block a user