mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(elasticsearch): fix for daily pattern when getting index for today, is now using utc, fixes #2913
This commit is contained in:
parent
6fecb4bf3e
commit
fc0705e87c
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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');
|
||||||
|
Loading…
Reference in New Issue
Block a user