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 ### 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) - 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 ### 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) - 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 - New endpoints for the stock transfer & stock entry edit capabilities mentioned above

View File

@ -220,9 +220,12 @@ Grocy.Components.DateTimePicker.GetInputElement().on('keyup', function(e)
dateObj = moment(value, format, true); dateObj = moment(value, format, true);
var element = Grocy.Components.DateTimePicker.GetInputElement()[0]; var element = Grocy.Components.DateTimePicker.GetInputElement()[0];
if (!dateObj.isValid()) if (!dateObj.isValid())
{
if ($(element).hasAttr("required"))
{ {
element.setCustomValidity("error"); element.setCustomValidity("error");
} }
}
else else
{ {
if (Grocy.Components.DateTimePicker.GetInputElement().data('limit-end-to-now') === true && dateObj.isAfter(moment())) if (Grocy.Components.DateTimePicker.GetInputElement().data('limit-end-to-now') === true && dateObj.isAfter(moment()))