From 9f9acb7f1cfab121991d6727789d9ecce24f9f38 Mon Sep 17 00:00:00 2001 From: fipwmaqzufheoxq92ebc <29818044+fipwmaqzufheoxq92ebc@users.noreply.github.com> Date: Sat, 12 Sep 2020 15:27:31 +0200 Subject: [PATCH] datetimepicker: Fix that SetValue did not set the value if "shortcut-checkbox" (e.g. "never expires") was checked. --- public/viewjs/components/datetimepicker.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/viewjs/components/datetimepicker.js b/public/viewjs/components/datetimepicker.js index 38b1f2da..461a952e 100644 --- a/public/viewjs/components/datetimepicker.js +++ b/public/viewjs/components/datetimepicker.js @@ -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(); }