UNPKG

@spalger/kibana

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

24 lines (19 loc) 563 B
define(function (require) { var parseInterval = require('ui/utils/parse_interval'); require('ui/modules') .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; } } }; }); });