mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 10:14:39 +00:00
Added a chore start date option (closes #1612)
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user