Skip to content

Commit 7b9391f

Browse files
committed
replace Sunday with Monday for ISO and Monday-based formats
1 parent 854c8c7 commit 7b9391f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/plots/cartesian/axes.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,13 @@ axes.autoTicks = function(ax, roughDTick) {
914914
// this will also move the base tick off 2000-01-01 if dtick is
915915
// 2 or 3 days... but that's a weird enough case that we'll ignore it.
916916
ax.tick0 = Lib.dateTick0(ax.calendar, true);
917+
918+
if(/%[uVW]/.test(ax.tickformat)) {
919+
// replace Sunday with Monday for ISO and Monday-based formats
920+
var len = ax.tick0.length;
921+
var lastD = +ax.tick0[len - 1];
922+
ax.tick0 = ax.tick0.substring(0, len - 2) + String(lastD + 1);
923+
}
917924
} else if(roughX2 > ONEHOUR) {
918925
ax.dtick = roundDTick(roughDTick, ONEHOUR, roundBase24);
919926
} else if(roughX2 > ONEMIN) {

0 commit comments

Comments
 (0)