Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time: Use callback helper on ticks.callback #8822

Merged
merged 1 commit into from Apr 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/scales/scale.time.js
@@ -1,5 +1,5 @@
import adapters from '../core/core.adapters';
import {isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core';
import {callback as call, isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core';
import {toRadians, isNumber, _limitValue} from '../helpers/helpers.math';
import Scale from '../core/core.scale';
import {_arrayUnique, _filterBetween, _lookup} from '../helpers/helpers.collection';
Expand Down Expand Up @@ -468,7 +468,7 @@ export default class TimeScale extends Scale {
const major = majorUnit && majorFormat && tick && tick.major;
const label = me._adapter.format(time, format || (major ? majorFormat : minorFormat));
const formatter = options.ticks.callback;
return formatter ? formatter(label, index, ticks) : label;
return formatter ? call(formatter, [label, index, ticks], me) : label;
}

/**
Expand Down