Open source personal finance application
feat (getTrns): add fromDate and untilDate
ilkome2748b0ec3c57
diff --git a/components/trns/functions/getTrns.ts b/components/trns/functions/getTrns.tsindex 6e1e45aa..1cc2a860 100644--- a/components/trns/functions/getTrns.ts+++ b/components/trns/functions/getTrns.ts@@ -11,6 +11,8 @@ interface Props {trnType?: TrnTypeperiodName?: PeriodNamedate?: Date+ fromDate?: number+ untilDate?: number}export const getTrnsIds = (props: Props) => {@@ -25,7 +27,7 @@ export const getTrnsIds = (props: Props) => {})}- // Date+ // @deprecated: Dateif (props?.date && props?.periodName !== 'all') {const filterDate = dayjs(props.date)const filterPeriod = props.periodName@@ -37,6 +39,14 @@ export const getTrnsIds = (props: Props) => {&& (props.trnsItems[trnId].date <= untilDate))}+ // From date+ if (props.fromDate)+ trnsIds = trnsIds.filter(trnId => (props.trnsItems[trnId].date >= props.fromDate))++ // Until date+ if (props.untilDate)+ trnsIds = trnsIds.filter(trnId => (props.trnsItems[trnId].date <= props.untilDate))+// Walletif (props.walletsIds?.length > 0) {trnsIds = trnsIds.filter((trnId: TrnID) => {