Fix logs view for dates that start in zero

Fixes #2081
This commit is contained in:
Joseph Schorr 2016-11-07 16:39:24 -05:00
parent 585a010c89
commit 4a1390e1a7

View file

@ -1126,7 +1126,12 @@ LogUsageChart.prototype.buildData_ = function(aggregatedLogs) {
var title = this.titleMap_[aggregated.kind] || aggregated.kind;
var datetime = parseDate(aggregated.datetime);
var formatted = (datetime.getMonth() + 1) + '/' + datetime.getDate();
var day = datetime.getDate();
if (day < 10) {
day = '0' + day;
}
var formatted = (datetime.getMonth() + 1) + '/' + day;
var justdate = new Date(datetime.getFullYear(), datetime.getMonth(), datetime.getDate());
var key = title + '_' + formatted;
var entry = {
@ -1205,10 +1210,6 @@ LogUsageChart.prototype.buildData_ = function(aggregatedLogs) {
* Renders the tooltip when hovering over an element in the chart.
*/
LogUsageChart.prototype.renderTooltip_ = function(d, e) {
if (e[0] == '0') {
e = e.substr(1);
}
var key = d + '_' + e;
var entry = this.entryMap_[key];
if (!entry) {