diff --git a/docs/sources/reference/table_panel.md b/docs/sources/reference/table_panel.md
index 381d16186a9..65437f85bd7 100644
--- a/docs/sources/reference/table_panel.md
+++ b/docs/sources/reference/table_panel.md
@@ -9,7 +9,7 @@ page_keywords: grafana, table, panel, documentation
The new table panel is very flexible, supporting both multiple modes for time series as well as for
-table, annotation and raw JSON data. It also provides date formating and value formating and coloring options.
+table, annotation and raw JSON data. It also provides date formatting and value formatting and coloring options.
To view table panels in action and test different configurations with sample data, check out the [Table Panel Showcase in the Grafana Playground](http://play.grafana.org/dashboard/db/table-panel-showcase).
@@ -21,7 +21,7 @@ The table panel has many ways to manipulate your data for optimal presentation.
1. `Data`: Control how your query is transformed into a table.
2. `Table Display`: Table display options.
-3. `Column Styles`: Column value formating and display options.
+3. `Column Styles`: Column value formatting and display options.
## Data to Table
diff --git a/public/app/core/utils/kbn.js b/public/app/core/utils/kbn.js
index 123e8e16be1..cc296324eb5 100644
--- a/public/app/core/utils/kbn.js
+++ b/public/app/core/utils/kbn.js
@@ -399,6 +399,7 @@ function($, _) {
// Volume
kbn.valueFormats.litre = kbn.formatBuilders.decimalSIPrefix('L');
kbn.valueFormats.mlitre = kbn.formatBuilders.decimalSIPrefix('L', -1);
+ kbn.valueFormats.m3 = kbn.formatBuilders.decimalSIPrefix('m3');
// Time
kbn.valueFormats.hertz = kbn.formatBuilders.decimalSIPrefix('Hz');
@@ -626,8 +627,9 @@ function($, _) {
{
text: 'volume',
submenu: [
- {text: 'millilitre', value: 'mlitre'},
- {text: 'litre', value: 'litre' },
+ {text: 'millilitre', value: 'mlitre'},
+ {text: 'litre', value: 'litre' },
+ {text: 'cubic metre', value: 'm3' },
]
},
{
diff --git a/public/app/features/dashboard/dashboardSrv.js b/public/app/features/dashboard/dashboardSrv.js
index 73919ce0e01..559adff5c54 100644
--- a/public/app/features/dashboard/dashboardSrv.js
+++ b/public/app/features/dashboard/dashboardSrv.js
@@ -214,10 +214,7 @@ function (angular, $, _, moment) {
};
p.formatDate = function(date, format) {
- if (!moment.isMoment(date)) {
- date = moment(date);
- }
-
+ date = moment.isMoment(date) ? date : moment(date);
format = format || 'YYYY-MM-DD HH:mm:ss';
return this.timezone === 'browser' ?
@@ -225,6 +222,14 @@ function (angular, $, _, moment) {
moment.utc(date).format(format);
};
+ p.getRelativeTime = function(date) {
+ date = moment.isMoment(date) ? date : moment(date);
+
+ return this.timezone === 'browser' ?
+ moment(date).fromNow() :
+ moment.utc(date).fromNow();
+ };
+
p._updateSchema = function(old) {
var i, j, k;
var oldVersion = this.schemaVersion;
diff --git a/public/app/features/dashboard/partials/settings.html b/public/app/features/dashboard/partials/settings.html
index 347265afed4..9b0e5674fe0 100644
--- a/public/app/features/dashboard/partials/settings.html
+++ b/public/app/features/dashboard/partials/settings.html
@@ -117,7 +117,7 @@