From 9496c8d943922f1e554fb5f67854302d61355d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Guti=C3=A9rrez?= Date: Wed, 8 May 2019 14:39:01 -0600 Subject: [PATCH] MSTR-5: Filter completed port requests by modified date (#354) --- .../submodules/portListing/portListing.js | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/apps/common/submodules/portListing/portListing.js b/src/apps/common/submodules/portListing/portListing.js index 0ae3b4e1e..b6e00ab8c 100644 --- a/src/apps/common/submodules/portListing/portListing.js +++ b/src/apps/common/submodules/portListing/portListing.js @@ -1174,25 +1174,31 @@ define(function(require) { }, /** + * @param {Object} args * @param {Function} args.success - * @param {String} args.tab - * @param {String} args.status - * @param {Object} args.filters + * @param {String} args.tab + * @param {String} args.type + * @param {Date} [args.fromDate] + * @param {Date} [args.toDate] */ portListingHelperListPorts: function(args) { var self = this, - dates = monster.util.getDefaultRangeDates(self.appFlags.portListing.range), - fromDate = monster.util.dateToBeginningOfGregorianDay(_.get(args, 'fromDate', dates.from)), - toDate = monster.util.dateToBeginningOfGregorianDay(_.get(args, 'toDate', dates.to)), filters = { paginate: false, by_types: args.type - }; + }, + dates, + fromDate, + toDate; if (self.portListingIsTypeCompleted(args.type)) { + dates = monster.util.getDefaultRangeDates(self.appFlags.portListing.range); + fromDate = _.get(args, 'fromDate', dates.from); + toDate = _.get(args, 'toDate', dates.to); + filters = _.merge(filters, { - created_from: fromDate, - created_to: toDate + modified_from: monster.util.dateToBeginningOfGregorianDay(fromDate), + modified_to: monster.util.dateToEndOfGregorianDay(toDate) }); }