value: function (value, ratio, id, index) {
return value.toFixed(2) + '°';
},
- title: function (x) {
- // TODO: format datetime into something readable
- return x;
+ title: function (datetime) {
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
+ options = {
+ weekday: 'short',
+ year: 'numeric', month: 'numeric', day: 'numeric',
+ hour: 'numeric', minute: 'numeric', second: 'numeric',
+ timeZone: 'Europe/Vienna', timeZoneName: 'short'
+ };
+ return datetime.toLocaleString('de-AT', options);
}
}
},