mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 10:14:39 +00:00
Allow best before date on purchase/inventory to be today or in the past, but display a hint when so (closes #172)
This commit is contained in:
@@ -193,6 +193,19 @@ Grocy.Components.DateTimePicker.GetInputElement().on('keyup', function(e)
|
||||
{
|
||||
element.setCustomValidity("");
|
||||
}
|
||||
|
||||
var earlierThanLimit = Grocy.Components.DateTimePicker.GetInputElement().data("earlier-than-limit");
|
||||
if (!earlierThanLimit.isEmpty())
|
||||
{
|
||||
if (moment(value).isBefore(moment(earlierThanLimit)))
|
||||
{
|
||||
$("#datetimepicker-earlier-than-info").removeClass("d-none");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#datetimepicker-earlier-than-info").addClass("d-none");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// "Click" the shortcut checkbox when the shortcut value was
|
||||
|
Reference in New Issue
Block a user