mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Improve date field query triggers
Don't submit the request if the user is part-way through typing something in the date field and the date is (currently) invalid; this results in the date ranges being broken and triggering a query for *all* results (with no date range).
This commit is contained in:
@@ -29,6 +29,8 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
formatted_start_date = moment($scope.startDate).format()
|
||||
formatted_end_date = moment($scope.endDate).add(1,'day').format()
|
||||
|
||||
return unless moment(formatted_start_date).isValid() and moment(formatted_start_date).isValid()
|
||||
|
||||
RequestMonitor.load $scope.orders = Orders.index(
|
||||
"q[state_not_eq]": "canceled",
|
||||
"q[completed_at_not_null]": "true",
|
||||
|
||||
Reference in New Issue
Block a user