Commit cac142b1 by Torkel Ödegaard

Merge pull request #2937 from mtanda/scripted_datemath

Use dateMath in ScriptedDashboard
parents da7ae2b0 4588c5a1
...@@ -4,8 +4,9 @@ define([ ...@@ -4,8 +4,9 @@ define([
'lodash', 'lodash',
'jquery', 'jquery',
'kbn', 'kbn',
'app/core/utils/datemath',
], ],
function (angular, moment, _, $, kbn) { function (angular, moment, _, $, kbn, dateMath) {
'use strict'; 'use strict';
var module = angular.module('grafana.services'); var module = angular.module('grafana.services');
...@@ -59,8 +60,8 @@ function (angular, moment, _, $, kbn) { ...@@ -59,8 +60,8 @@ function (angular, moment, _, $, kbn) {
}; };
/*jshint -W054 */ /*jshint -W054 */
var script_func = new Function('ARGS','kbn','_','moment','window','document','$','jQuery', 'services', result.data); var script_func = new Function('ARGS','kbn','dateMath','_','moment','window','document','$','jQuery', 'services', result.data);
var script_result = script_func($routeParams, kbn, _ , moment, window, document, $, $, services); var script_result = script_func($routeParams, kbn, dateMath, _ , moment, window, document, $, $, services);
// Handle async dashboard scripts // Handle async dashboard scripts
if (_.isFunction(script_result)) { if (_.isFunction(script_result)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment