2 Commits
Author SHA1 Message Date
brian 8c007aa6f3 Merge pull request 'show-most-recent-feeding-session' (#39) from show-most-recent-feeding-session into main
Python Code Quality / python-code-quality (push) Successful in 10s
Python Test / python-test (push) Successful in 19s
Build and Push Docker Image / build-and-push (push) Successful in 26s
Refresh Showcase Data / refresh-data (push) Failing after 2m10s
Reviewed-on: #39
2025-12-03 21:41:12 +01:00
Brian Bjarke Jensen 63fc4b618c CQ fixes
Build and Push Docker Image / build-and-push (pull_request) Successful in 1m0s
Python Code Quality / python-code-quality (pull_request) Successful in 10s
Python Test / python-test (pull_request) Successful in 19s
2025-12-03 21:29:36 +01:00
+6 -4
View File
@@ -410,7 +410,9 @@
const prevEnd = entry.end_time || entry.start_time;
const sessionStartDate = new Date(sessionStart);
const prevEndDate = new Date(prevEnd);
const diffMins = Math.abs((sessionStartDate - prevEndDate) / 60000);
const diffMins = Math.abs(
(sessionStartDate - prevEndDate) / 60000,
);
if (diffMins > 30) {
break;
}
@@ -421,7 +423,7 @@
// Calculate accumulated feeding time for all events in the session
let accumulatedMinutes = 0;
sessionEntries.forEach(entry => {
sessionEntries.forEach((entry) => {
if (entry.end_time && entry.start_time) {
const start = new Date(entry.start_time);
const end = new Date(entry.end_time);
@@ -434,14 +436,14 @@
// Build a string showing all feeding types used during the session
const feedingTypesSet = new Set();
sessionEntries.forEach(entry => {
sessionEntries.forEach((entry) => {
if (entry.feeding_type) {
feedingTypesSet.add(entry.feeding_type);
}
});
const feedingTypesString = Array.from(feedingTypesSet)
.map(formatFeedingType)
.join(', ');
.join(", ");
// Compose a session object
lastFeeding = {