Skip to content

Commit

Permalink
Time: Use callback helper on ticks.callback (#8822)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Apr 4, 2021
1 parent 3943306 commit 7d08bab
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 7d08bab

Please sign in to comment.