Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix interval.range for DST.

  • Loading branch information...
commit 99ec34ac829a44af39058728f3869ef7a8b82d43 1 parent 2045a75
@jasondavies jasondavies authored
View
6 d3.js
@@ -8223,12 +8223,12 @@ d3 = function() {
return date - d0 < d1 - date ? d0 : d1;
}
function ceil(date) {
- date = local(new d3_time(date - 1));
- var t = +date, d;
+ var d0 = +date, d;
+ date = local(new d3_time(d0 - 1));
do {
step(date, 1);
d = local(date);
- } while (+d === t);
+ } while (d < d0);
return d;
}
function offset(date, k) {
View
2  d3.min.js
1 addition, 1 deletion not shown
View
6 src/time/interval.js
@@ -8,12 +8,12 @@ function d3_time_interval(local, step, number) {
}
function ceil(date) {
- date = local(new d3_time(date - 1));
- var t = +date, d;
+ var d0 = +date, d;
+ date = local(new d3_time(d0 - 1));
do {
step(date, 1);
d = local(date);
- } while (+d === t);
+ } while (d < d0);
return d;
}
View
9 test/time/days-test.js
@@ -47,6 +47,15 @@ suite.addBatch({
local(2011, 10, 8)
]);
},
+ "DST": time.dst(local(2014, 02, 28), local(2014, 02, 28, 01), function(range) {
+ assert.deepEqual(range(local(2014, 02, 26, 12), local(2014, 02, 31, 12)), [
+ local(2014, 02, 27),
+ local(2014, 02, 28, 01),
+ local(2014, 02, 29),
+ local(2014, 02, 30),
+ local(2014, 02, 31)
+ ]);
+ }),
"UTC": {
topic: function(range) {
return range.utc;
Please sign in to comment.
Something went wrong with that request. Please try again.