mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 00:08:55 +00:00
fix: timeseries time zone issue for sql queries (#1555)
For SQL queries in some timezone, there was a difference between the time showing in the x-axis. This issue is fixed by converting it to the correct timezone.  Co-authored-by: ktx-keshavi <keshavi.bhalani@kiara.tech>
This commit is contained in:
co-authored by
ktx-keshavi
parent
e7fcf1c6d9
commit
4509c4da2a
@@ -74,10 +74,7 @@ export const convertSQLData = (
|
||||
);
|
||||
if (field && field.alias == key) {
|
||||
// now we have the format, convert that format
|
||||
result = result.map(
|
||||
(it: any) =>
|
||||
new Date(it).getTime() - new Date("1970-01-01T00:00:00").getTime()
|
||||
);
|
||||
result = result.map((it: any) => new Date(it+ "Z").getTime());
|
||||
}
|
||||
return result;
|
||||
};
|
||||
@@ -847,8 +844,7 @@ export const convertSQLData = (
|
||||
if (isTimeSeries) {
|
||||
options.series.map((seriesObj: any) => {
|
||||
seriesObj.data = seriesObj.data.map((it: any, index: any) => [
|
||||
new Date(options.xAxis.data[index]).getTime() -
|
||||
new Date("1970-01-01T00:00:00").getTime(),
|
||||
new Date(options.xAxis.data[index]+ "Z").getTime(),
|
||||
it,
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user