Fix timezone bug causing steps to show as 0
This commit is contained in:
+2
-1
@@ -1607,7 +1607,8 @@ function getStepsForPeriod(stepsByDate, period) {
|
|||||||
const keys = Object.keys(stepsByDate || {});
|
const keys = Object.keys(stepsByDate || {});
|
||||||
let total = 0;
|
let total = 0;
|
||||||
for (const k of keys) {
|
for (const k of keys) {
|
||||||
const d = new Date(k);
|
const parts = k.split('-');
|
||||||
|
const d = new Date(parseInt(parts[0]), parseInt(parts[1]) - 1, parseInt(parts[2]));
|
||||||
if (period === 'day') {
|
if (period === 'day') {
|
||||||
if (isSameDay(d, today)) total += stepsByDate[k];
|
if (isSameDay(d, today)) total += stepsByDate[k];
|
||||||
} else if (period === 'week') {
|
} else if (period === 'week') {
|
||||||
|
|||||||
Reference in New Issue
Block a user