chore: rename fromISONano to be more explicit
This commit is contained in:
parent
eef562762a
commit
58d0174934
@ -1,6 +1,6 @@
|
||||
import {
|
||||
addDecimal,
|
||||
fromISONanoSeconds,
|
||||
fromISONano,
|
||||
t,
|
||||
useThemeSwitcher,
|
||||
} from '@vegaprotocol/react-helpers';
|
||||
@ -228,7 +228,7 @@ export const AccountHistoryChart = ({
|
||||
.reduce((acc, edge) => {
|
||||
if (edge.node.accountType === accountType) {
|
||||
acc?.push({
|
||||
datetime: fromISONanoSeconds(edge.node.timestamp),
|
||||
datetime: fromISONano(edge.node.timestamp),
|
||||
balance: Number(addDecimal(edge.node.balance, asset.decimals)),
|
||||
});
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useStatisticsQuery } from '../utils/__generated__/Node';
|
||||
import { useHeaderStore } from '@vegaprotocol/apollo-client';
|
||||
import { fromISONanoSeconds } from '@vegaprotocol/react-helpers';
|
||||
import { fromISONano } from '@vegaprotocol/react-helpers';
|
||||
import { useEnvironment } from './use-environment';
|
||||
|
||||
export const useNodeHealth = () => {
|
||||
@ -27,7 +27,7 @@ export const useNodeHealth = () => {
|
||||
|
||||
return {
|
||||
coreBlockHeight: Number(data?.statistics.blockHeight || 0),
|
||||
coreVegaTime: fromISONanoSeconds(data?.statistics.vegaTime),
|
||||
coreVegaTime: fromISONano(data?.statistics.vegaTime),
|
||||
datanodeBlockHeight: headers?.blockHeight,
|
||||
datanodeVegaTime: headers?.timestamp,
|
||||
blockDiff,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {
|
||||
addDecimalsFormatNumber,
|
||||
DateRangeFilter,
|
||||
fromISONanoSeconds,
|
||||
fromISONano,
|
||||
getDateTimeFormat,
|
||||
SetFilter,
|
||||
t,
|
||||
@ -199,7 +199,7 @@ export const LedgerTable = forwardRef<AgGridReact, LedgerEntryProps>(
|
||||
valueFormatter={({
|
||||
value,
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'vegaTime'>) =>
|
||||
value ? getDateTimeFormat().format(fromISONanoSeconds(value)) : '-'
|
||||
value ? getDateTimeFormat().format(fromISONano(value)) : '-'
|
||||
}
|
||||
filter={DateRangeFilter}
|
||||
/>
|
||||
|
@ -4,7 +4,7 @@ export const toNanoSeconds = (date: Date | string) => {
|
||||
return new Date(date).getTime().toString() + '000000';
|
||||
};
|
||||
|
||||
export const fromISONanoSeconds = (ts: string) => {
|
||||
export const fromISONano = (ts: string) => {
|
||||
const val = parseISO(ts);
|
||||
return new Date(isValid(val) ? val : 0);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user