diff --git a/public/app/plugins/datasource/elasticsearch/index_pattern.js b/public/app/plugins/datasource/elasticsearch/index_pattern.js index 29ddc9e5741..d565e22c0b6 100644 --- a/public/app/plugins/datasource/elasticsearch/index_pattern.js +++ b/public/app/plugins/datasource/elasticsearch/index_pattern.js @@ -20,7 +20,7 @@ function (_, moment) { IndexPattern.prototype.getIndexForToday = function() { if (this.interval) { - return moment().format(this.pattern); + return moment.utc().format(this.pattern); } else { return this.pattern; } diff --git a/public/app/plugins/datasource/elasticsearch/specs/index_pattern_specs.ts b/public/app/plugins/datasource/elasticsearch/specs/index_pattern_specs.ts index 8f662bb075f..ccebef59a12 100644 --- a/public/app/plugins/datasource/elasticsearch/specs/index_pattern_specs.ts +++ b/public/app/plugins/datasource/elasticsearch/specs/index_pattern_specs.ts @@ -8,7 +8,7 @@ declare var IndexPattern: any; describe('IndexPattern', function() { - describe('when getting index for today', function() { + describe.only('when getting index for today', function() { it('should return correct index name', function() { var pattern = new IndexPattern('[asd-]YYYY.MM.DD', 'Daily'); var expected = 'asd-' + moment().format('YYYY.MM.DD');