Feat/800: Corrected mistake in get-enactment-timestamp.ts
This commit is contained in:
@@ -167,7 +167,7 @@ export const ProposeNewMarket = () => {
|
||||
},
|
||||
},
|
||||
})}
|
||||
labelOverride={'Terms.changes.newMarket (JSON format)'}
|
||||
labelOverride={'Terms.newMarket (JSON format)'}
|
||||
errorMessage={errors?.proposalTerms?.message}
|
||||
/>
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { addHours, addMinutes, getTime } from 'date-fns';
|
||||
|
||||
export const getClosingTimestamp = (proposalVoteDeadline: number) => {
|
||||
return Math.floor(
|
||||
export const getClosingTimestamp = (proposalVoteDeadline: number) =>
|
||||
Math.floor(
|
||||
getTime(
|
||||
proposalVoteDeadline === 1
|
||||
? addHours(addMinutes(new Date(Date.now()), 2), proposalVoteDeadline)
|
||||
: addHours(new Date(Date.now()), proposalVoteDeadline)
|
||||
) / 1000
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import { addHours, getTime } from 'date-fns';
|
||||
import { addHours, fromUnixTime, getTime } from 'date-fns';
|
||||
import { getClosingTimestamp } from './get-closing-timestamp';
|
||||
|
||||
export const getEnactmentTimestamp = (
|
||||
proposalVoteDeadline: number,
|
||||
enactmentDeadline: number
|
||||
) =>
|
||||
getTime(
|
||||
addHours(getClosingTimestamp(proposalVoteDeadline), enactmentDeadline)
|
||||
);
|
||||
Math.floor(
|
||||
getTime(
|
||||
addHours(
|
||||
new Date(fromUnixTime(getClosingTimestamp(proposalVoteDeadline))),
|
||||
enactmentDeadline
|
||||
)
|
||||
)
|
||||
) / 1000;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { addHours, addMinutes, getTime } from 'date-fns';
|
||||
|
||||
export const getValidationTimestamp = (proposalValidationDeadline: number) => {
|
||||
return Math.floor(
|
||||
export const getValidationTimestamp = (proposalValidationDeadline: number) =>
|
||||
Math.floor(
|
||||
getTime(
|
||||
proposalValidationDeadline === 0
|
||||
? addHours(
|
||||
@@ -11,4 +11,3 @@ export const getValidationTimestamp = (proposalValidationDeadline: number) => {
|
||||
: addHours(new Date(Date.now()), proposalValidationDeadline)
|
||||
) / 1000
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user