Skip to content

Commit

Permalink
fix: change get current time range (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loori-R committed Jul 10, 2023
1 parent d3a37a0 commit 6b39ec3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## tip

* BUGFIX: respect time filter for variables update. See [this issue](https://github.com/VictoriaMetrics/grafana-datasource/issues/47)

## [v0.2.0](https://github.com/VictoriaMetrics/grafana-datasource/releases/tag/v0.2.0)

* FEATURE: add the ability to define expressions for each panel so that users can define WITH templates once and then reuse them. See [this issue](https://github.com/VictoriaMetrics/grafana-datasource/issues/35).
Expand Down
4 changes: 3 additions & 1 deletion src/services/TimeSrv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ export class TimeSrv {
};

timeRange(): TimeRange {
return getTimeRange(this.time, this.timeModel);
// @ts-ignore default time
const time = getTemplateSrv()?.timeRange?.raw || getDefaultTimeRange().raw;
return getTimeRange(time, this.timeModel)
}

zoomOut(factor: number, updateUrl = true) {
Expand Down

0 comments on commit 6b39ec3

Please sign in to comment.