Use offset in check
This commit is contained in:
parent
c82447cf7a
commit
837adc7b17
1 changed files with 1 additions and 1 deletions
|
@ -15,7 +15,7 @@ next_thursday_offset=$(( ( ( 7 - $day_of_week ) + 4 ) % 7 ))
|
||||||
|
|
||||||
## Check if next Thursday is the first of a month
|
## Check if next Thursday is the first of a month
|
||||||
|
|
||||||
if (( $(date +%d) > 7 )); then
|
if (( $(date -d "+$next_thursday_offset days" +%d) > 7 )); then
|
||||||
echo "Invitation should be sent at most a week in advance."
|
echo "Invitation should be sent at most a week in advance."
|
||||||
echo "Exiting without sending an inviation..."
|
echo "Exiting without sending an inviation..."
|
||||||
exit
|
exit
|
||||||
|
|
Loading…
Reference in a new issue