onChange: function (selectedDates, dateStr, instance) {
if (selectedDates.length > 0) {
const selectedDate = selectedDates[0];
- const selectedWeek = selectedDate.getFullYear() + "-W" + getWeekNumber(selectedDate);
+ const selectedWeek = getWeekYear(selectedDate) + "-W" + getWeekNumber(selectedDate);
instance.input.value = selectedWeek;
// Redirect to the new URL for the selected week
const newUrl = `{{ script_name }}/weekly_report/${selectedWeek}`;
@@ -185,7 +191,10 @@
Total Detections: 0 | Unique Species: 0
function getMondayOfWeek(weekString) {
const [year, week] = weekString.split('-W');
const date = new Date(year, 0, (week) * 7 + 1);
- date.setDate(date.getDate() - (date.getDay() + 6) % 7);
+ if (date.getDay() <= 4) {
+ date.setDate(date.getDate() - 7);
+ }
+ date.setDate(date.getDate() - date.getDay() + 1);
return date;
}
diff --git a/docker-compose.yml b/docker-compose.yml
index bd2411c..9c819df 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -14,12 +14,14 @@ services:
- "7667:8080"
redis:
+ restart: unless-stopped
image: "redis:latest" #the redis server doesn't need to be exposed outside the virtual network, so no "ports"
#mapping is needed
networks:
- birdcage_net
birdcage_backend:
+ restart: unless-stopped
image: "mmcc73/birdcage_backend:latest"
ports:
- "7007:7007"
@@ -43,7 +45,7 @@ services:
#to be fancy you can use a device on a remote machine and put its address here. See the wiki
#SCRIPT_NAME: /birdcage # Uncomment this if you want to reverse proxy to BirdCAGE at a subfolder like /birdcage/
tmpfs:
- - /tmp:size=16M #you might want to increase this size if you are recording a bunch of streams, if your
+ - /tmp:size=64M #you might want to increase this size if you are recording a bunch of streams, if your
# streams are particularly hi-res, or if your analyzer might be periodically unavailable
#volumes_from: #uncomment for HA addon
# - container:addon_local_birdcage #uncomment for HA addon
@@ -58,6 +60,7 @@ services:
- birdcage_net
birdcage_frontend:
+ restart: unless-stopped
image: "mmcc73/birdcage_frontend:latest"
ports:
- "7008:7008"
@@ -67,7 +70,6 @@ services:
#SCRIPT_NAME: /birdcage # Uncomment this if you want to reverse proxy to BirdCAGE at a subfolder like /birdcage/
#TITLE_TEXT: Your Title Here
#TITLE_LINK: http://yourlinkhere
- #TITLE_TEXT: Your Title Here
#Include the above variables if you want to put some text, and optionally a link, in the nav bar
volumes:
- "/etc/localtime:/etc/localtime:ro"