UNPKG

kibana-123

Version:

Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic

23 lines (18 loc) 518 B
import parseInterval from 'ui/utils/parse_interval'; import uiModules from 'ui/modules'; uiModules .get('kibana') .directive('validateDateInterval', function () { return { restrict: 'A', require: 'ngModel', link: function ($scope, $el, attrs, ngModelCntrl) { ngModelCntrl.$parsers.push(check); ngModelCntrl.$formatters.push(check); function check(value) { ngModelCntrl.$setValidity('dateInterval', parseInterval(value) != null); return value; } } }; });