Skip to content

Commit

Permalink
fix: show correct end date for early execution
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijnK committed Jun 30, 2023
1 parent 236c0eb commit 5d1447b
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

0 comments on commit 5d1447b

Please sign in to comment.