Create 2 RSVP end dates

This commit is contained in:
2017-03-29 21:59:05 +01:00
parent 75740699f1
commit cdc6614c63
3 changed files with 40 additions and 38 deletions

View File

@@ -6,13 +6,13 @@ import NotFound from '../notFound/NotFound';
import { rsvpEndDate, getRsvpEnd } from '../../config';
let title = 'RSVP';
let attending = 'day';
export default {
path: '/rsvp/:password',
isEditable() {
return new Date() < rsvpEndDate;
return new Date() < rsvpEndDate[attending];
},
async action({ params }) {
@@ -35,6 +35,9 @@ export default {
};
}
// Assuming all connected guests have the same invite
attending = people[0].ceremony ? 'day' : 'evening';
return {
title,
component: (
@@ -42,7 +45,7 @@ export default {
<Rsvp
title={title}
people={people}
rsvpEnd={getRsvpEnd()}
rsvpEnd={getRsvpEnd(attending)}
isEditable={this.isEditable()}
/>
</Layout>