Skip to content

Commit a8e03f6

Browse files
authored
Convert timezone and format date (#1862)
1 parent 5f98b6a commit a8e03f6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

scheduler/src/common/helper/garms.helper.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { GarmsExtractType } from 'src/modules/common/enum/garms-extract-type.enu
2020
import { DateTransaction } from 'src/modules/garms/dto/DateTransation.dto';
2121
import { GarmaCashDetail } from 'src/modules/garms/dto/garms-cash-details.dto';
2222
import { GarmaCashHeader } from 'src/modules/garms/dto/garms-cash-header.dto';
23-
import { dateFormat } from './date-time.helper';
23+
import { convertUtcToPt, dateFormat } from './date-time.helper';
2424
import * as fs from 'fs';
2525
import * as path from 'path';
2626
import { InternalServerErrorException, Logger } from '@nestjs/common';
@@ -275,11 +275,9 @@ export const groupTransactionsByDate = (transactions: Transaction[]) => {
275275
// Group transactions by the date (ignoring the time part)
276276
const groupedData: Record<string, Transaction[]> = transactions.reduce(
277277
(acc, transaction) => {
278+
278279
// Extract just the date part (YYYY-MM-DD)
279-
const transactionDate = transaction.transactionSubmitDate
280-
.toISOString()
281-
.split('T')[0];
282-
280+
const transactionDate = convertUtcToPt(transaction.transactionSubmitDate,"YYYY-MM-DD");
283281
// If the date group doesn't exist, create it
284282
if (!acc[transactionDate]) {
285283
acc[transactionDate] = [];

0 commit comments

Comments
 (0)