[view-graph,bugfix][xs]: hovers for time series render dates correctly (rather than as large integers).
This commit is contained in:
@@ -319,6 +319,13 @@ my.Graph = Backbone.View.extend({
|
|||||||
}
|
}
|
||||||
y = y.toFixed(2);
|
y = y.toFixed(2);
|
||||||
|
|
||||||
|
// is it time series
|
||||||
|
var xfield = self.model.fields.get(self.state.attributes.group);
|
||||||
|
var isDateTime = xfield.get('type') === 'date';
|
||||||
|
if (isDateTime) {
|
||||||
|
x = new Date(parseInt(x)).toLocaleDateString();
|
||||||
|
}
|
||||||
|
|
||||||
var content = _.template('<%= group %> = <%= x %>, <%= series %> = <%= y %>', {
|
var content = _.template('<%= group %> = <%= x %>, <%= series %> = <%= y %>', {
|
||||||
group: self.state.attributes.group,
|
group: self.state.attributes.group,
|
||||||
x: x,
|
x: x,
|
||||||
|
|||||||
Reference in New Issue
Block a user