Skip to content

Commit 6d95ecd

Browse files
Copilotlarsdecker
andcommitted
Add cross-platform date command examples for macOS and Linux
Co-authored-by: larsdecker <1968186+larsdecker@users.noreply.github.com>
1 parent 921c72a commit 6d95ecd

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

packages/fints-cli/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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):
285283
START_DATE=$(date -d "last month" +%Y-%m-01)
286284
END_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
289292
fints-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

0 commit comments

Comments
 (0)