CQ fixes
This commit is contained in:
@@ -410,7 +410,9 @@
|
|||||||
const prevEnd = entry.end_time || entry.start_time;
|
const prevEnd = entry.end_time || entry.start_time;
|
||||||
const sessionStartDate = new Date(sessionStart);
|
const sessionStartDate = new Date(sessionStart);
|
||||||
const prevEndDate = new Date(prevEnd);
|
const prevEndDate = new Date(prevEnd);
|
||||||
const diffMins = Math.abs((sessionStartDate - prevEndDate) / 60000);
|
const diffMins = Math.abs(
|
||||||
|
(sessionStartDate - prevEndDate) / 60000,
|
||||||
|
);
|
||||||
if (diffMins > 30) {
|
if (diffMins > 30) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -421,7 +423,7 @@
|
|||||||
|
|
||||||
// Calculate accumulated feeding time for all events in the session
|
// Calculate accumulated feeding time for all events in the session
|
||||||
let accumulatedMinutes = 0;
|
let accumulatedMinutes = 0;
|
||||||
sessionEntries.forEach(entry => {
|
sessionEntries.forEach((entry) => {
|
||||||
if (entry.end_time && entry.start_time) {
|
if (entry.end_time && entry.start_time) {
|
||||||
const start = new Date(entry.start_time);
|
const start = new Date(entry.start_time);
|
||||||
const end = new Date(entry.end_time);
|
const end = new Date(entry.end_time);
|
||||||
@@ -434,14 +436,14 @@
|
|||||||
|
|
||||||
// Build a string showing all feeding types used during the session
|
// Build a string showing all feeding types used during the session
|
||||||
const feedingTypesSet = new Set();
|
const feedingTypesSet = new Set();
|
||||||
sessionEntries.forEach(entry => {
|
sessionEntries.forEach((entry) => {
|
||||||
if (entry.feeding_type) {
|
if (entry.feeding_type) {
|
||||||
feedingTypesSet.add(entry.feeding_type);
|
feedingTypesSet.add(entry.feeding_type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const feedingTypesString = Array.from(feedingTypesSet)
|
const feedingTypesString = Array.from(feedingTypesSet)
|
||||||
.map(formatFeedingType)
|
.map(formatFeedingType)
|
||||||
.join(', ');
|
.join(", ");
|
||||||
|
|
||||||
// Compose a session object
|
// Compose a session object
|
||||||
lastFeeding = {
|
lastFeeding = {
|
||||||
|
|||||||
Reference in New Issue
Block a user