From faabe8ef21ba7d133cecaa0a924c33b540b1d58d Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Tue, 20 Dec 2011 10:01:53 +0100 Subject: [PATCH] [script][log_editor] bug fix in end date calculation --- scripts/log_editor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/log_editor.sh b/scripts/log_editor.sh index 004b49d..63b1fba 100755 --- a/scripts/log_editor.sh +++ b/scripts/log_editor.sh @@ -103,7 +103,7 @@ toMail () { day_to_monday=$(($curr_day -1)) day_to_friday=$((5 - $curr_day)) start_date=$(date --date="$((date_arg + day_to_monday)) days ago" +%Y-%m-%d) - stop_date=$(date --date="$((date_arg + day_to_friday)) days" +%Y-%m-%d) + stop_date=$(date --date="$((date_arg - day_to_friday)) days ago" +%Y-%m-%d) echo "Weekly $start_date -> $stop_date" view $1 } @@ -115,7 +115,7 @@ sendMail () { day_to_monday=$(($curr_day -1)) day_to_friday=$((5 - $curr_day)) start_date=$(date --date="$((date_arg + day_to_monday)) days ago" +%Y-%m-%d) - stop_date=$(date --date="$((date_arg + day_to_friday)) days" +%Y-%m-%d) + stop_date=$(date --date="$((date_arg - day_to_friday)) days ago" +%Y-%m-%d) view $1 |mail -s "Weekly $start_date -> $stop_date" $USER@dxo.com }