diff --git a/plugins/panel-triggers/editor.html b/plugins/panel-triggers/editor.html
index bed41eb..d92105c 100644
--- a/plugins/panel-triggers/editor.html
+++ b/plugins/panel-triggers/editor.html
@@ -61,7 +61,7 @@
placeholder="trigger name"
class="input-large tight-form-input last"
ng-style="panel.triggers.trigger.style"
- empty-to-null">
+ empty-to-null>
@@ -192,6 +192,38 @@
+
diff --git a/plugins/panel-triggers/module.js b/plugins/panel-triggers/module.js
index 6bf8cff..8f780bd 100644
--- a/plugins/panel-triggers/module.js
+++ b/plugins/panel-triggers/module.js
@@ -81,7 +81,7 @@ function (angular, app, _, $, moment, config, PanelMeta) {
sortTriggersBy: { text: 'last change', value: 'lastchange' },
showEvents: { text: 'Problem events', value: '1' },
triggerSeverity: grafanaDefaultSeverity,
- okEventColor: '#890F02'
+ okEventColor: '#890F02',
};
_.defaults($scope.panel, panelDefaults);
@@ -97,7 +97,8 @@ function (angular, app, _, $, moment, config, PanelMeta) {
var scopeDefaults = {
metric: {},
inputStyles: {},
- oldTarget: _.cloneDeep($scope.panel.triggers)
+ oldTarget: _.cloneDeep($scope.panel.triggers),
+ defaultTimeFormat: "DD MMM YYYY HH:mm:ss"
};
_.defaults($scope, scopeDefaults);
@@ -141,7 +142,12 @@ function (angular, app, _, $, moment, config, PanelMeta) {
// Format last change and age
trigger.lastchangeUnix = Number(trigger.lastchange);
var timestamp = moment.unix(trigger.lastchangeUnix);
- triggerObj.lastchange = timestamp.format("DD MMM YYYY, HH:mm:ss");
+ if ($scope.panel.customLastChangeFormat) {
+ // User defined format
+ triggerObj.lastchange = timestamp.format($scope.panel.lastChangeFormat);
+ } else {
+ triggerObj.lastchange = timestamp.format($scope.defaultTimeFormat);
+ }
triggerObj.age = timestamp.fromNow(true);
// Set color