Skip to content

Commit

Permalink
fix: sum until the end of day
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Le committed Mar 18, 2024
1 parent b7fefb3 commit e3c03b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/repositories/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const updateTransactionById = (id: string, updateById: string, status: nu
);

export const getTotalAmountByDays = async (days: number) => {
const date = moment().utc().subtract(days, 'days').toDate();
const date = moment().utc().endOf('day').subtract(days, 'days').toDate();
const query =
days == 0
? { status: TransactionStatus.success, type: TransactionType.deposit }
Expand Down

0 comments on commit e3c03b1

Please sign in to comment.