mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
Fixed bug where number of weeks was miscalculated
This commit is contained in:
parent
6fb708acea
commit
b67c1b2358
@ -303,7 +303,7 @@ class Morris.Line
|
||||
if y2.getDay() isnt 4
|
||||
y2.setMonth(0, 1 + ((4 - y2.getDay()) + 7) % 7);
|
||||
# Number of weeks between thursdays
|
||||
weeks = 1 + Math.ceil((y2 - y1) / 604800000);
|
||||
weeks = Math.ceil((y2 - y1) / 604800000);
|
||||
parseInt(p[1], 10) + (parseInt(p[2], 10) - 1) / weeks;
|
||||
else if n
|
||||
parseInt(n[1], 10) + (parseInt(n[2], 10) - 1) / 12
|
||||
|
@ -328,7 +328,7 @@
|
||||
y2 = new Date(year + 1, 0, 1);
|
||||
if (y1.getDay() !== 4) y1.setMonth(0, 1 + ((4 - y1.getDay()) + 7) % 7);
|
||||
if (y2.getDay() !== 4) y2.setMonth(0, 1 + ((4 - y2.getDay()) + 7) % 7);
|
||||
weeks = 1 + Math.ceil((y2 - y1) / 604800000);
|
||||
weeks = Math.ceil((y2 - y1) / 604800000);
|
||||
return parseInt(p[1], 10) + (parseInt(p[2], 10) - 1) / weeks;
|
||||
} else if (n) {
|
||||
return parseInt(n[1], 10) + (parseInt(n[2], 10) - 1) / 12;
|
||||
|
2
morris.min.js
vendored
2
morris.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user