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

fix: show correct end date for early execution #156

Merged
merged 2 commits into from
Jul 10, 2023
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
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