Skip to content

Commit

Permalink
Merge pull request #156 from SecureSECODAO/dev
Browse files Browse the repository at this point in the history
fix: show correct end date for early execution
  • Loading branch information
SecureSECO-DAO committed Jul 10, 2023
2 parents be4d99b + 869f559 commit 3b9013a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/proposal/ProposalHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const getProposalMilestones = (proposal: Proposal) => {
res.push({
label: 'Succeeded',
variant: 'done',
// If the executionDate is earlier than endDate, there was an early execution, so endDate executionDate is also the end date
// If the executionDate is earlier than endDate, there was an early execution, so executionDate is also the end date
// Note that in general, the exectionDate will not be defined if the proposal status is unequal to Executed
date:
proposal.executionDate &&
compareAsc(proposal.executionDate, proposal.endDate) === -1
Expand Down
8 changes: 8 additions & 0 deletions src/pages/ViewProposal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ const ViewProposal = () => {
return 'Starts in ' + countdownText(proposal.startDate);
case ProposalStatus.Active:
return 'Ends in ' + countdownText(proposal.endDate);
case ProposalStatus.Executed:
return (
'Executed ' +
(proposal.executionDate
? countdownText(proposal.executionDate)
: '?') +
' ago'
);
default:
return 'Ended ' + countdownText(proposal.endDate) + ' ago';
}
Expand Down

1 comment on commit 3b9013a

@vercel
Copy link

@vercel vercel bot commented on 3b9013a Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.