diff --git a/public/js/components/Cis/Coodle/Components/CoodleSurvey/CoodleSurveyVotingTable.js b/public/js/components/Cis/Coodle/Components/CoodleSurvey/CoodleSurveyVotingTable.js index cd93d0ca3..718756858 100644 --- a/public/js/components/Cis/Coodle/Components/CoodleSurvey/CoodleSurveyVotingTable.js +++ b/public/js/components/Cis/Coodle/Components/CoodleSurvey/CoodleSurveyVotingTable.js @@ -63,6 +63,27 @@ export default { room.longName.toLowerCase().includes(roomFilterText), ); }, + timeslotDates() { + if (!this.$props.timeslots.length) return []; + + let groupedTimeslots = Object.groupBy( + this.$props.timeslots, + (timeslot) => { + return timeslot.startsAt.toISOString().slice(0, 10); + }, + ); + return Object.keys(groupedTimeslots) + .sort() + .map((dateKey) => { + let timeslotDate = groupedTimeslots[dateKey]; + return { + count: timeslotDate.length, + date: timeslotDate[0].date, + weekday: timeslotDate[0].weekday, + month: timeslotDate[0].month, + }; + }); + }, }, watch: { survey: { @@ -172,7 +193,7 @@ export default { // )[0]; this.externalParticipantsWithoutAuthUser = externalParticipants; - // + // }, setData() { this.setForms(); @@ -446,11 +467,11 @@ export default {
| - | + |
- {{ timeslot.month.slice(0,3) }}
- {{ timeslot.date }}
- {{ timeslot.weekday.slice(0,3) }}
+ {{ timeslotDate.month.slice(0,3) }}
+ {{ timeslotDate.date }}
+ {{ timeslotDate.weekday.slice(0,3) }}
|