Skip to content

Commit 083eae3

Browse files
committed
use a Sunday instead of Monday for weekly period0
1 parent 397bf63 commit 083eae3

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/traces/scatter/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function axisPeriod0(axis) {
4343
'Only relevant when the axis `type` is *date*.',
4444
'Sets the base for period positioning in milliseconds or date string on the ' + axis + ' axis.',
4545
'When `' + axis + 'period` is round number of weeks,',
46-
'the `' + axis + 'period0` by default would be on a Monday i.e. 1970-01-05,',
46+
'the `' + axis + 'period0` by default would be on a Sunday i.e. 1970-01-04,',
4747
'otherwise it would be at 1970-01-01.'
4848
].join(' ')
4949
};

src/traces/scatter/period_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function getPeriod0Dflt(period) {
1515
var n = period / ONEWEEK;
1616

1717
return Math.round(n) === n ?
18-
'1970-01-05' : // a Monday
18+
'1970-01-04' : // a Sunday
1919
'1970-01-01';
2020
}
2121

455 Bytes
Loading

test/image/mocks/period_positioning8.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
"hovertemplate": "%{x|%A}, %{y}",
1515
"type": "bar",
1616
"y": [
17-
21,
18-
21,
19-
21,
20-
21,
17+
28,
18+
28,
19+
28,
2120
12,
2221
12,
2322
12,
2423
12,
2524
12,
2625
12,
2726
12,
28-
28,
29-
28,
30-
28
27+
21,
28+
21,
29+
21,
30+
21
3131
],
3232
"x": [
3333
"2020-01-16",

0 commit comments

Comments
 (0)