fix(elasticsearch): fix for daily pattern when getting index for today, is now using utc, fixes #2913

This commit is contained in:
Torkel Ödegaard 2015-10-21 10:59:02 -04:00
parent 6fecb4bf3e
commit fc0705e87c
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ function (_, moment) {
IndexPattern.prototype.getIndexForToday = function() { IndexPattern.prototype.getIndexForToday = function() {
if (this.interval) { if (this.interval) {
return moment().format(this.pattern); return moment.utc().format(this.pattern);
} else { } else {
return this.pattern; return this.pattern;
} }

View File

@ -8,7 +8,7 @@ declare var IndexPattern: any;
describe('IndexPattern', function() { 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() { it('should return correct index name', function() {
var pattern = new IndexPattern('[asd-]YYYY.MM.DD', 'Daily'); var pattern = new IndexPattern('[asd-]YYYY.MM.DD', 'Daily');
var expected = 'asd-' + moment().format('YYYY.MM.DD'); var expected = 'asd-' + moment().format('YYYY.MM.DD');