Skip to content

Commit

Permalink
Fix parsing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Jul 14, 2020
1 parent f21e4cd commit 9105b69
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { isEmpty, isNumber, get } from 'lodash/fp';
import { isEmpty, get } from 'lodash/fp';
import memoizeOne from 'memoize-one';

import { escapeQueryValue, convertToBuildEsQuery } from '../../../common/lib/keury';
Expand All @@ -23,6 +23,8 @@ import {
Filter,
} from '../../../../../../../src/plugins/data/public';

const isNumber = (value: string | number) => !isNaN(Number(value));

const convertDateFieldToQuery = (field: string, value: string | number) =>
`${field}: ${isNumber(value) ? value : new Date(value).valueOf()}`;

Expand Down

0 comments on commit 9105b69

Please sign in to comment.