Skip to content

Commit 4550ff1

Browse files
committed
Fixed: Parsing logic time records to grass graph has more day gap
1 parent 7bd88de commit 4550ff1

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

components/Record/RecordOverview/RecordOverview.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,19 @@ export default function RecordOverview() {
105105
aRecord.endTime
106106
);
107107

108-
if (res.length === 0) {
109-
for (let i = 0; i < dayGapWithCurrentDate; i++) {
108+
if (dayGapWithCurrentDate >= 1) {
109+
for (
110+
let i = 0;
111+
i < dayGapWithCurrentDate - (res.length === 0 ? 0 : 1);
112+
i++
113+
) {
110114
res.push(0);
111115
}
116+
res.push(parseMSToMin(aRecord.duration));
117+
} else {
118+
res[res.length - 1] += parseMSToMin(aRecord.duration);
112119
}
113120

114-
for (let i = 0; i < dayGapWithCurrentDate; i++) {
115-
res.push(0);
116-
}
117-
118-
res[res.length - 1] += parseMSToMin(aRecord.duration);
119-
120121
currentDate = aRecord.endTime;
121122
});
122123

next.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ const nextConfig = {
1111
basePath: isDevServer ? "/absproxy/3000" : "",
1212
};
1313

14-
// module.exports = withPWA(nextConfig);
15-
module.exports = nextConfig;
14+
module.exports = withPWA(nextConfig);
15+
// module.exports = nextConfig;

0 commit comments

Comments
 (0)