diff --git a/app/vmui/packages/vmui/src/components/Configurators/TimeRangeSettings/TimeSelector/TimeSelector.tsx b/app/vmui/packages/vmui/src/components/Configurators/TimeRangeSettings/TimeSelector/TimeSelector.tsx index d362277fc..43e9596d1 100644 --- a/app/vmui/packages/vmui/src/components/Configurators/TimeRangeSettings/TimeSelector/TimeSelector.tsx +++ b/app/vmui/packages/vmui/src/components/Configurators/TimeRangeSettings/TimeSelector/TimeSelector.tsx @@ -71,8 +71,8 @@ export const TimeSelector: FC = () => { const setTimeAndClosePicker = () => { if (from && until) { dispatch({ type: "SET_PERIOD", payload: { - from: dayjs(from).toDate(), - to: dayjs(until).toDate() + from: dayjs.tz(from).toDate(), + to: dayjs.tz(until).toDate() } }); } setOpenOptions(false); diff --git a/app/vmui/packages/vmui/src/utils/time.ts b/app/vmui/packages/vmui/src/utils/time.ts index 2b789c25f..b6c13713a 100644 --- a/app/vmui/packages/vmui/src/utils/time.ts +++ b/app/vmui/packages/vmui/src/utils/time.ts @@ -165,10 +165,12 @@ export const getTimezoneList = (search = "") => { return supportedTimezones.reduce((acc: {[key: string]: Timezone[]}, region) => { const zone = (region.match(/^(.*?)\//) || [])[1] || "unknown"; const utc = getUTCByTimezone(region); + const utcForSearch = utc.replace(/UTC|0/gmi, ""); + const regionForSearch = region.replace(/[/_]/gmi, " "); const item = { region, utc, - search: `${region} ${utc} ${region.replace(/[/_]/gmi, " ")}` + search: `${region} ${utc} ${regionForSearch} ${utcForSearch}` }; const includeZone = !search || (search && regexp.test(item.search)); diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 3bc637222..49d7c7ab2 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -27,6 +27,7 @@ Released at 2022-12-20 * BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): never extend explicitly set lookbehind window for [rate()](https://docs.victoriametrics.com/MetricsQL.html#rate) function. This reduces the level of confusion when the user expects the needed results after explicitly seting the lookbehind window `[d]` in the query `rate(m[d])`. Previously VictoriaMetrics could silently extend the lookbehind window, so it covers at least two raw samples. Now this behavior works only if the lookbehind window in square brackets isn't set explicitly, e.g. in the case of `rate(m)`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3483) for details. * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): respect `-usePromCompatibleNaming` flag if no relabeling or extra labels were set. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3511) for details. * BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix the wrong legend when queries are hidden. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3512). +* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix incorrect time selection after the timezone change. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3519). ## [v1.85.2](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.85.2)