From c8ab077835d7ac2d3d26a63d4952ee290ae6a289 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sat, 2 Oct 2021 12:32:30 -0400 Subject: [PATCH] new WEEK calculation --- scripts/birdnet_analysis.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index af5fdf7..f3e9dd5 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -42,7 +42,7 @@ run_analysis() { ### TESTING NEW WEEK CALCULATION - WEEK_OF_YEAR="$(echo "$(date +%m) * 4" | bc -l)" + WEEK_OF_YEAR="$(echo "($(date +%m)-1) * 4" | bc -l)" DAY_OF_MONTH="$(date +%d)" if [ ${DAY_OF_MONTH} -le 7 ];then WEEK="$(echo "${WEEK_OF_YEAR} + 1" |bc -l)" @@ -50,7 +50,7 @@ run_analysis() { WEEK="$(echo "${WEEK_OF_YEAR} + 2" |bc -l)" elif [ ${DAY_OF_MONTH} -le 21 ];then WEEK="$(echo "${WEEK_OF_YEAR} + 3" |bc -l)" - elif [ ${DAY_OF_MONTH} -ge 23 ];then + elif [ ${DAY_OF_MONTH} -ge 22 ];then WEEK="$(echo "${WEEK_OF_YEAR} + 4" |bc -l)" fi