File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,9 +133,8 @@ const client = new PinTanClient({
133133const accounts = await client .accounts ();
134134
135135// Fetch last 30 days of transactions
136- const startDate = new Date ();
137- startDate .setDate (startDate .getDate () - 30 );
138136const endDate = new Date ();
137+ const startDate = new Date (endDate .getTime () - 30 * 24 * 60 * 60 * 1000 );
139138
140139const statements = await client .statements (accounts [0 ], startDate , endDate );
141140
Original file line number Diff line number Diff line change @@ -283,10 +283,10 @@ fints-lib fetch-transactions \
283283START_DATE=$( date -d " last month" +%Y-%m-01)
284284END_DATE=$( date -d " -1 day $( date +%Y-%m-01) " +%Y-%m-%d)
285285
286- # For macOS (BSD date), use:
287- # START_DATE=$(date -v-1m +%Y-%m-01)
288- # END_DATE =$(date -v1d -v-1m -v-1d +%Y-%m-%d )
289- # Or install GNU coreutils (brew install coreutils) and use 'gdate'
286+ # For macOS (BSD date), install GNU coreutils and use 'gdate' :
287+ # brew install coreutils
288+ # START_DATE =$(gdate -d "last month" +%Y-%m-01 )
289+ # END_DATE=$(gdate -d "-1 day $(gdate +%Y-%m-01)" +%Y-%m-%d)
290290
291291# Fetch transactions
292292fints-lib fetch-transactions \
Original file line number Diff line number Diff line change @@ -232,8 +232,7 @@ const accounts = await client.accounts();
232232
233233// Get transactions from the last 30 days
234234const endDate = new Date ();
235- const startDate = new Date ();
236- startDate .setDate (startDate .getDate () - 30 );
235+ const startDate = new Date (endDate .getTime () - 30 * 24 * 60 * 60 * 1000 );
237236
238237const statements = await client .statements (accounts [0 ], startDate , endDate );
239238
You can’t perform that action at this time.
0 commit comments