Added a chore start date option (closes #1612)

This commit is contained in:
Bernd Bestel
2022-02-08 20:35:47 +01:00
parent 411dbabc90
commit 61a1b1428a
7 changed files with 132 additions and 1 deletions

View File

@@ -8,6 +8,8 @@
}
var jsonData = $('#chore-form').serializeJSON();
jsonData.start_date = Grocy.Components.DateTimePicker.GetValue();
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
{
jsonData.assignment_config = $("#assignment_config").val().join(",");
@@ -107,6 +109,23 @@ Grocy.Components.UserfieldsForm.Load();
$('#name').focus();
Grocy.FrontendHelpers.ValidateForm('chore-form');
if (Grocy.EditMode == "edit")
{
Grocy.Api.Get('objects/chores_log?limit=1&query[]=chore_id=' + Grocy.EditObjectId,
function(journalEntries)
{
if (journalEntries.length > 0)
{
$(".datetimepicker-input").attr("disabled", "");
}
},
function(xhr)
{
console.error(xhr);
}
);
}
setTimeout(function()
{
$(".input-group-chore-period-type").trigger("change");