datetimepicker: Fix that SetValue did not set the value if "shortcut-checkbox" (e.g. "never expires") was checked.

This commit is contained in:
fipwmaqzufheoxq92ebc 2020-09-12 15:27:31 +02:00
parent 515da5d27f
commit 9f9acb7f1c
No known key found for this signature in database
GPG Key ID: F4DF989490C2ADB7

View File

@ -12,9 +12,6 @@ Grocy.Components.DateTimePicker.GetValue = function()
Grocy.Components.DateTimePicker.SetValue = function(value)
{
Grocy.Components.DateTimePicker.GetInputElement().val(value);
Grocy.Components.DateTimePicker.GetInputElement().trigger('change');
// "Click" the shortcut checkbox when the desired value is
// not the shortcut value and it is currently set
var shortcutValue = $("#datetimepicker-shortcut").data("datetimepicker-shortcut-value");
@ -22,6 +19,8 @@ Grocy.Components.DateTimePicker.SetValue = function(value)
{
$("#datetimepicker-shortcut").click();
}
Grocy.Components.DateTimePicker.GetInputElement().val(value);
Grocy.Components.DateTimePicker.GetInputElement().trigger('change');
Grocy.Components.DateTimePicker.GetInputElement().keyup();
}