Make the meal plan entry day editable (closes #775)

This commit is contained in:
Bernd Bestel
2022-04-03 17:03:23 +02:00
parent 97626b4a59
commit d4eb5f07db
6 changed files with 90 additions and 67 deletions

View File

@@ -25,8 +25,7 @@ Grocy.Components.DateTimePicker.SetValue = function(value, inputElement = Grocy.
Grocy.Components.DateTimePicker.Clear = function()
{
$(".datetimepicker").datetimepicker("destroy");
Grocy.Components.DateTimePicker.Init();
Grocy.Components.DateTimePicker.Init(true);
Grocy.Components.DateTimePicker.GetInputElement().val("");
@@ -74,8 +73,13 @@ if (Grocy.Components.DateTimePicker.GetInputElement().data('limit-end-to-now') =
limitDate = moment();
}
Grocy.Components.DateTimePicker.Init = function()
Grocy.Components.DateTimePicker.Init = function(reInit = false)
{
if (reInit)
{
$(".datetimepicker").datetimepicker("destroy");
}
$(".datetimepicker").each(function()
{
$(this).datetimepicker(