Пример #1
0
 $scope.dateFilter = function(billingItem) {
   if ($scope.filter.parsedDates.startDt && $scope.filter.parsedDates.endDt) {
     return (_.gte(billingItem.itemEffectiveDate, $scope.filter.parsedDates.startDt) && _.lte(billingItem.itemEffectiveDate, $scope.filter.parsedDates.endDt));
   }
   if ($scope.filter.parsedDates.startDt) {
     return _.gte(billingItem.itemEffectiveDate, $scope.filter.parsedDates.startDt);
   }
   if ($scope.filter.parsedDates.endDt) {
     return _.lte(billingItem.itemEffectiveDate, $scope.filter.parsedDates.endDt);
   }
   return true;
 };
Пример #2
0
            var sanitized = _.reduce(received.fields, function(memo, f) {
                if(_.gte(fcontent.fields.indexOf(f), 0)) {
                    var value = received.metadata[f];
                    if(_.isUndefined(value))
                        debug("field %s declared but not found", f);
                    else if(value === "true")
                        value = true;
                    else if(value === "false")
                        value = false

                    /* other special checks can be put here */
                    memo[f] = value;
                } else {
                    debug("Unauthorized field %s for %s: IGNORED",
                        f, fcontent.name);
                }
                return memo;
            }, {});
Пример #3
0
 gte: function (param, num) { // req.assert('param', 'Invalid Param').gte(5)
   return _.gte(param, num)
 },