Explore: Fixes incorrect handling of utc in timeEpic (#18386)

* Fix: Fixes incorrect handling of utc in timeEpic

* Chore: Renames dateTimeFromTimeZone to dateTimeForTimeZone
This commit is contained in:
Hugo Häggmark
2019-08-06 10:43:53 +02:00
committed by GitHub
parent cbfdac43d8
commit ead2d6e88f
8 changed files with 34 additions and 34 deletions

View File

@@ -8,7 +8,7 @@ import {
isDateTime,
dateTime,
DateTime,
toUtc,
dateTimeForTimeZone,
} from '@grafana/data';
export const rawToTimeRange = (raw: RawTimeRange, timeZone?: TimeZone): TimeRange => {
@@ -32,11 +32,7 @@ export const stringToDateTimeType = (value: string | DateTime, roundUp?: boolean
return parsed || dateTime();
}
if (timeZone === 'utc') {
return toUtc(value, TIME_FORMAT);
}
return dateTime(value, TIME_FORMAT);
return dateTimeForTimeZone(timeZone, value, TIME_FORMAT);
};
export const mapTimeRangeToRangeString = (timeRange: RawTimeRange): string => {