Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show timestamps in the local timezone #212

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading