File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,14 +277,17 @@ fints-lib fetch-transactions \
277277``` bash
278278#! /bin/bash
279279# monthly-statement.sh - Fetch last month's transactions
280- # Note: This script uses GNU date syntax. On macOS, install GNU coreutils:
281- # brew install coreutils
282- # and use 'gdate' instead of 'date'
283280
284281# Calculate date range for last month
282+ # For Linux (GNU date):
285283START_DATE=$( date -d " last month" +%Y-%m-01)
286284END_DATE=$( date -d " -1 day $( date +%Y-%m-01) " +%Y-%m-%d)
287285
286+ # For macOS (BSD date), use:
287+ # START_DATE=$(date -v-1m +%Y-%m-01)
288+ # END_DATE=$(date -v-1d -v1d +%Y-%m-%d)
289+ # Or install GNU coreutils (brew install coreutils) and use 'gdate'
290+
288291# Fetch transactions
289292fints-lib fetch-transactions \
290293 --url " $FINTS_URL " \
@@ -294,9 +297,9 @@ fints-lib fetch-transactions \
294297 -i " $ACCOUNT_IBAN " \
295298 -s " $START_DATE " \
296299 -e " $END_DATE " \
297- --json > " statement-$( date -d ' last month ' +%Y-%m) .json"
300+ --json > " statement-$( date +%Y-%m) .json"
298301
299- echo " Statement saved for $( date -d ' last month ' +%B %Y ) "
302+ echo " Statement saved for period: $START_DATE to $END_DATE "
300303```
301304
302305### Check Multiple Accounts
You can’t perform that action at this time.
0 commit comments