Allow empty date(time) inputs when the field is not required (fixes #462(

This commit is contained in:
Bernd Bestel 2020-01-03 13:50:10 +01:00
parent 0be672aa48
commit 675bf25927
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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
{