Skip to content

Commit

Permalink
[TSVB] use boolean instead of number
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaanj committed May 5, 2021
1 parent 1c72466 commit beff6ed
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function createIntervalBasedFormatter(
ignoreDaylightTime: boolean
) {
const fixedOffset = moment(JANUARY_MOMENT_CONFIG).utcOffset();
return (val: moment.MomentInput): string => {
return (val: moment.MomentInput) => {
const momentVal = moment(val);
if (ignoreDaylightTime) {
momentVal.utcOffset(fixedOffset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class TimeseriesPanelConfig extends Component<
legend_position: 'right',
show_grid: 1,
tooltip_mode: 'show_all',
ignore_daylight_time: 0,
ignore_daylight_time: false,
};
const model = { ...defaults, ...this.props.model };
const { selectedTab } = this.state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function TimeseriesVisualization({
`${isVisSeriesData(visData) ? model.id : 'series[0]'}.series[0].data`,
undefined
)}
ignoreDaylightTime={Boolean(model.ignore_daylight_time)}
ignoreDaylightTime={model.ignore_daylight_time}
panelInterval={getInterval(visData, model)}
modelInterval={model.interval ?? AUTO_INTERVAL}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ class TimeseriesVisualization extends Component {
interval,
this.scaledDataFormat,
this.dateFormat,
Boolean(this.props.model.ignore_daylight_time)
this.props.model.ignore_daylight_time
);
return (val) => {
return formatter(val);
};
return (val) => formatter(val);
};

yAxisStackedByPercentFormatter = (val) => {
Expand Down

0 comments on commit beff6ed

Please sign in to comment.