We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15ace45 commit f053f62Copy full SHA for f053f62
src/ducks/recurrence/service.js
@@ -13,12 +13,16 @@ import { getLabel } from './utils'
13
import addDays from 'date-fns/add_days'
14
15
const NB_MONTH_LOOKBACK = 3
16
+const DAYS_IN_MONTH = 30.5
17
18
const makeQueryForTransactions = recurrences => {
19
if (recurrences.length === 0) {
20
return Q(TRANSACTION_DOCTYPE)
21
} else {
- const lookbackDateLimit = addDays(new Date(), -NB_MONTH_LOOKBACK * 30.5)
22
+ const lookbackDateLimit = addDays(
23
+ new Date(),
24
+ -NB_MONTH_LOOKBACK * DAYS_IN_MONTH
25
+ )
26
const query = Q(TRANSACTION_DOCTYPE).where({
27
date: {
28
$gt: lookbackDateLimit.toISOString().slice(0, 10)
0 commit comments