[view-graph,bugfix][xs]: hovers for time series render dates correctly (rather than as large integers).

This commit is contained in:
Rufus Pollock 2012-05-09 03:40:41 +01:00
parent 5e002adb4e
commit 79ce138751

View File

@ -318,6 +318,13 @@ my.Graph = Backbone.View.extend({
x = x.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 %>', {
group: self.state.attributes.group,