Skip to content

Commit

Permalink
show timestamps in the local timezone (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
TopETH authored Aug 10, 2024
1 parent 1660930 commit d2d5146
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 15 deletions.
5 changes: 1 addition & 4 deletions src/components/Tables/PurchaseHistoryTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ export const PurchaseHistoryTable = ({ data }: PurchaseHistoryTableProps) => {
</StyledTableCell>
<StyledTableCell align='center'>{type}</StyledTableCell>
<StyledTableCell align='center'>
{timeAgo.format(
new Date(timestamp).getTime(),
'round-minute'
)}
{timeAgo.format(timestamp, 'round-minute')}
</StyledTableCell>
</StyledTableRow>
)
Expand Down
5 changes: 1 addition & 4 deletions src/components/Tables/TxHistoryTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ export const TxHistoryTable = ({ data }: TxHistoryTableProps) => {
)}
</StyledTableCell>
<StyledTableCell align='center'>
{timeAgo.format(
new Date(timestamp).getTime(),
'round-minute'
)}
{timeAgo.format(timestamp, 'round-minute')}
</StyledTableCell>
</StyledTableRow>
)
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/accountExtrinsics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const useAccountExtrinsics = (
extrinsicId: item.id,
module: item.module,
call: item.call,
timestamp: item.timestamp,
timestamp: new Date(`${item.timestamp}Z`),
success: item.success,
} as AccountTxHistoryItem)
)
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/sale/purchaseHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const usePurchaseHistory = (
address: account,
core,
extrinsicId: `${height}-${extrinsicId}`,
timestamp,
timestamp: new Date(`${timestamp}Z`),
price: parseInt(price),
type: purchaseType,
} as PurchaseHistoryItem)
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/sale/saleDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const useSaleDetails = (network: NetworkType, saleCycle: number) => {
address: account,
core,
extrinsicId: `${height}-${extrinsicId}`,
timestamp,
timestamp: new Date(`${timestamp}Z`),
price: parseInt(price),
type: purchaseType,
} as PurchaseHistoryItem)
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/sale/salesHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export const useSalesHistory = (network: NetworkType) => {
regionEnd,
startBlock: height,
endBlock: saleEnd,
startTimestamp: Date.parse(timestamp),
endTimestamp: Date.parse(tsSaleEnd),
startTimestamp: Date.parse(`${timestamp}Z`),
endTimestamp: Date.parse(`${tsSaleEnd}Z`),
startPrice,
endPrice,
} as SalesHistoryItem)
Expand Down
2 changes: 1 addition & 1 deletion src/models/extrinsics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export type AccountTxHistoryItem = {
extrinsicId: string;
module: string;
call: string;
timestamp: string;
timestamp: Date;
success: boolean;
};
2 changes: 1 addition & 1 deletion src/models/regions/sale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export type PurchaseHistoryItem = {
address: string;
core: number;
extrinsicId: string;
timestamp: string;
timestamp: Date;
price: number;
type: string;
};
Expand Down

0 comments on commit d2d5146

Please sign in to comment.