Skip to content

Commit

Permalink
parse_interval
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Jan 3, 2020
1 parent c6952ab commit 1278a0c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 177 deletions.
119 changes: 0 additions & 119 deletions src/legacy/ui/public/utils/parse_interval.test.ts

This file was deleted.

56 changes: 0 additions & 56 deletions src/legacy/ui/public/utils/parse_interval.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/plugins/data/common/utils/parse_interval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import _ from 'lodash';
import { find } from 'lodash';
import moment, { unitOfTime } from 'moment';
import dateMath from '@elastic/datemath';

Expand All @@ -44,7 +44,7 @@ export function parseInterval(interval: string): moment.Duration | null {
// adding 0.5 days until we hit the end date. However, since there is a bug in moment, when you add 0.5 days to
// the start date, you get the same exact date (instead of being ahead by 12 hours). So instead of returning
// a duration corresponding to 0.5 hours, we return a duration corresponding to 12 hours.
const selectedUnit = _.find(
const selectedUnit = find(
dateMath.units,
u => Math.abs(duration.as(u)) >= 1
) as unitOfTime.Base;
Expand Down

0 comments on commit 1278a0c

Please sign in to comment.