diff --git a/src/marks/axis.js b/src/marks/axis.js index 39b287520fd..5d5c8190bdb 100644 --- a/src/marks/axis.js +++ b/src/marks/axis.js @@ -542,12 +542,13 @@ function axisMark(mark, k, ariaLabel, data, options, initialize) { // ordinal time // TODO determine whether the interval is utc or local time? // TODO assert that the interval is one of utcTick’s known intervals? + // TODO add ceil to the RangeIntervalImplementation interface? if (isTimeInterval(scale.interval)) { - const type = "utc"; // TODO detect whether interval is utc or local + const type = "utc"; const [start, stop] = extent(data); if (interval) { data = maybeRangeInterval(interval, type).range(start, stop); - data = data.map(scale.interval.floor, scale.interval); + data = data.map(scale.interval.ceil ?? scale.interval.floor, scale.interval); } else { if (ticks === undefined) { const [min, max] = extent(scale.range()); diff --git a/test/output/timeAxisOrdinalIrregular.svg b/test/output/timeAxisOrdinalIrregular.svg index 07a68339c61..c37db16b13a 100644 --- a/test/output/timeAxisOrdinalIrregular.svg +++ b/test/output/timeAxisOrdinalIrregular.svg @@ -39,18 +39,18 @@ ↑ Close - - - - - + + + + + - 2013 - 2014 - 2015 - 2016 - 2017 + 2014 + 2015 + 2016 + 2017 + 2018 2013-05-13