Skip to content

Commit a435981

Browse files
committed
partial support for range selectors on world calendars
1 parent c1c24e8 commit a435981

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/components/rangeselector/get_update_object.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
var d3 = require('d3');
1313

14-
var Lib = require('../../lib');
15-
16-
1714
module.exports = function getUpdateObject(axisLayout, buttonLayout) {
1815
var axName = axisLayout._name;
1916
var update = {};
@@ -33,7 +30,7 @@ module.exports = function getUpdateObject(axisLayout, buttonLayout) {
3330

3431
function getXRange(axisLayout, buttonLayout) {
3532
var currentRange = axisLayout.range;
36-
var base = new Date(Lib.dateTime2ms(currentRange[1]));
33+
var base = new Date(axisLayout.r2l(currentRange[1]));
3734

3835
var step = buttonLayout.step,
3936
count = buttonLayout.count;
@@ -42,13 +39,13 @@ function getXRange(axisLayout, buttonLayout) {
4239

4340
switch(buttonLayout.stepmode) {
4441
case 'backward':
45-
range0 = Lib.ms2DateTime(+d3.time[step].utc.offset(base, -count));
42+
range0 = axisLayout.l2r(+d3.time[step].utc.offset(base, -count));
4643
break;
4744

4845
case 'todate':
4946
var base2 = d3.time[step].utc.offset(base, -count);
5047

51-
range0 = Lib.ms2DateTime(+d3.time[step].utc.ceil(base2));
48+
range0 = axisLayout.l2r(+d3.time[step].utc.ceil(base2));
5249
break;
5350
}
5451

0 commit comments

Comments
 (0)