Skip to content

Commit

Permalink
Fix start and end date with voting period and delay (snapshot-labs#919)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam <[email protected]>
  • Loading branch information
ChaituVR and samuveth authored Oct 22, 2021
1 parent 4aa39bc commit 66a51f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/views/SpaceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ async function handleSubmit() {
form.value.choices = choices.value.map(choice => choice.text);
form.value.metadata.network = props.space.network;
form.value.metadata.strategies = props.space.strategies;
form.value.start = dateStart.value;
form.value.end = dateEnd.value;
form.value.start = props.space.voting?.delay
? new Date().getTime() / 1000 + props.space.voting.delay
: dateStart.value;
form.value.end = props.space.voting?.period
? form.value.start + props.space.voting.period
: dateEnd.value;
try {
const { ipfsHash } = await send(props.space.id, 'proposal', form.value);
notify(['green', t('notify.proposalCreated')]);
Expand Down

0 comments on commit 66a51f0

Please sign in to comment.