Skip to content

Commit 1278a0c

Browse files
committed
parse_interval
1 parent c6952ab commit 1278a0c

File tree

3 files changed

+2
-177
lines changed

3 files changed

+2
-177
lines changed

src/legacy/ui/public/utils/parse_interval.test.ts

Lines changed: 0 additions & 119 deletions
This file was deleted.

src/legacy/ui/public/utils/parse_interval.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/plugins/data/common/utils/parse_interval.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
import _ from 'lodash';
20+
import { find } from 'lodash';
2121
import moment, { unitOfTime } from 'moment';
2222
import dateMath from '@elastic/datemath';
2323

@@ -44,7 +44,7 @@ export function parseInterval(interval: string): moment.Duration | null {
4444
// 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
4545
// the start date, you get the same exact date (instead of being ahead by 12 hours). So instead of returning
4646
// a duration corresponding to 0.5 hours, we return a duration corresponding to 12 hours.
47-
const selectedUnit = _.find(
47+
const selectedUnit = find(
4848
dateMath.units,
4949
u => Math.abs(duration.as(u)) >= 1
5050
) as unitOfTime.Base;

0 commit comments

Comments
 (0)