From 675bf25927e282a38005cf2e27728fa0ffe99c2c Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Fri, 3 Jan 2020 13:50:10 +0100 Subject: [PATCH] Allow empty date(time) inputs when the field is not required (fixes #462( --- changelog/55_UNRELEASED_2019-xx-xx.md | 3 +++ public/viewjs/components/datetimepicker.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog/55_UNRELEASED_2019-xx-xx.md b/changelog/55_UNRELEASED_2019-xx-xx.md index ca4d540f..a52c6ca0 100644 --- a/changelog/55_UNRELEASED_2019-xx-xx.md +++ b/changelog/55_UNRELEASED_2019-xx-xx.md @@ -16,6 +16,9 @@ ### Calendar improvements - Improved that meal plan events in the iCal calendar export now contain a link to the appropriate meal plan week in the body of the event (thanks @kriddles) +### Task fixes +- Fixed that a due date was required when editing an existing task + ### API improvements/fixes - Fixed that the route `/stock/barcodes/external-lookup/{barcode}` did not work, because the `barcode` argument was expected as a route argument but the route was missing it (thanks @Mikhail5555 and @beetle442002) - New endpoints for the stock transfer & stock entry edit capabilities mentioned above diff --git a/public/viewjs/components/datetimepicker.js b/public/viewjs/components/datetimepicker.js index d673a942..a785b072 100644 --- a/public/viewjs/components/datetimepicker.js +++ b/public/viewjs/components/datetimepicker.js @@ -221,7 +221,10 @@ Grocy.Components.DateTimePicker.GetInputElement().on('keyup', function(e) var element = Grocy.Components.DateTimePicker.GetInputElement()[0]; if (!dateObj.isValid()) { - element.setCustomValidity("error"); + if ($(element).hasAttr("required")) + { + element.setCustomValidity("error"); + } } else {