fix current streak
always start from today
This commit is contained in:
@ -7,7 +7,7 @@ var _ = require('lodash'),
|
|||||||
const daysBetween = 1.5;
|
const daysBetween = 1.5;
|
||||||
|
|
||||||
function calcCurrentStreak(cals) {
|
function calcCurrentStreak(cals) {
|
||||||
const revCals = cals.slice().reverse();
|
const revCals = cals.concat([Date.now()]).slice().reverse();
|
||||||
let streakBroken = false;
|
let streakBroken = false;
|
||||||
const lastDayInStreak = revCals
|
const lastDayInStreak = revCals
|
||||||
.reduce((current, cal, index) => {
|
.reduce((current, cal, index) => {
|
||||||
|
Reference in New Issue
Block a user