Skip to content

Commit 27fb4b1

Browse files
committed
tighter test for when to remove seconds from date tick text
make sure it's not already HH:MM
1 parent 426077a commit 27fb4b1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plots/cartesian/axes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,9 @@ function formatDate(ax, out, hover, extraPrecision) {
11531153
tt = suffix;
11541154
suffix = '';
11551155
}
1156-
else {
1156+
else if(tt.length === 8) {
1157+
// strip off seconds if they're zero (zero fractional seconds
1158+
// are already omitted)
11571159
tt = tt.replace(/:00$/, '');
11581160
}
11591161
}

0 commit comments

Comments
 (0)