Fix logs graphs tooltips for months < 10

Fixes #2342
This commit is contained in:
Joseph Schorr 2017-02-08 17:18:37 -08:00
parent 8d96d8b682
commit f569cea4b3

View file

@ -1126,12 +1126,10 @@ LogUsageChart.prototype.buildData_ = function(aggregatedLogs) {
var title = this.titleMap_[aggregated.kind] || aggregated.kind;
var datetime = parseDate(aggregated.datetime);
var day = datetime.getDate();
if (day < 10) {
day = '0' + day;
}
var day = ('0' + datetime.getDate()).slice(-2);
var month = ('0' + (datetime.getMonth() + 1)).slice(-2);
var formatted = (datetime.getMonth() + 1) + '/' + day;
var formatted = month + '/' + day;
var justdate = new Date(datetime.getFullYear(), datetime.getMonth(), datetime.getDate());
var key = title + '_' + formatted;
var entry = {