How to use the @smile-io/ember-polaris/components/polaris-resource-list/filter-control/filter-value-selector.FilterType.DateSelector function in @smile-io/ember-polaris

To help you get started, we’ve selected a few @smile-io/ember-polaris examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github smile-io / ember-polaris / addon / components / polaris-resource-list / filter-control.js View on Github external
function findOperatorLabel(filter, appliedFilter) {
  let operatorText = get(filter, 'operatorText');

  if (
    filter.type === FilterType.DateSelector &&
    (get(appliedFilter, 'key') === get(filter, 'minKey') ||
      get(appliedFilter, 'key') === get(filter, 'maxKey'))
  ) {
    return '';
  }

  if (!operatorText || typeof operatorText === 'string') {
    return operatorText;
  }

  let appliedOperator = operatorText.find((operator) => {
    return get(operator, 'key') === get(appliedFilter, 'key');
  });

  if (appliedOperator) {
    return (