fixes #4: days with groups are highlighted
This commit is contained in:
parent
890dad90db
commit
6da63a8c0b
3 changed files with 22 additions and 4 deletions
22
src/App.vue
22
src/App.vue
|
@ -2,7 +2,7 @@
|
||||||
<div id="main-attendees">
|
<div id="main-attendees">
|
||||||
<md-layout md-gutter md-row>
|
<md-layout md-gutter md-row>
|
||||||
<md-layout md-column md-flex="20" md-gutter>
|
<md-layout md-column md-flex="20" md-gutter>
|
||||||
<datepicker id="datepicker" :value="date" :inline="true" @selected="getDay"></datepicker>
|
<datepicker id="datepicker" :value="date" :inline="true" :highlighted="highlightedDates" @selected="getDay"></datepicker>
|
||||||
</md-layout>
|
</md-layout>
|
||||||
<md-layout id="panel" md-column>
|
<md-layout id="panel" md-column>
|
||||||
<md-layout md-row>
|
<md-layout md-row>
|
||||||
|
@ -27,6 +27,26 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
highlightedDates() {
|
||||||
|
var ds = this.daysSummary.days || [];
|
||||||
|
var datesWithGroups = [];
|
||||||
|
for (var i=0; i < ds.length; i++) {
|
||||||
|
var [year, month, day] = ds[i].day.split('-');
|
||||||
|
year = parseInt(year);
|
||||||
|
month = parseInt(month) - 1;
|
||||||
|
day = parseInt(day);
|
||||||
|
if (isNaN(year) || isNaN(month) || isNaN(day)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
datesWithGroups.push(new Date(year, month, day));
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
dates: datesWithGroups
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
beforeCreate: function() {
|
beforeCreate: function() {
|
||||||
this.daysUrl = this.$resource('days{/day}');
|
this.daysUrl = this.$resource('days{/day}');
|
||||||
this.attendeesUrl = this.$resource('attendees{/id}');
|
this.attendeesUrl = this.$resource('attendees{/id}');
|
||||||
|
|
|
@ -33,7 +33,6 @@ export default {
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
loggedInUser() {
|
loggedInUser() {
|
||||||
console.log(this.$store.state.loggedInUser);
|
|
||||||
return this.$store.state.loggedInUser;
|
return this.$store.state.loggedInUser;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -73,7 +73,6 @@ export default {
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
alert('deleteUser: unable to get resource');
|
alert('deleteUser: unable to get resource');
|
||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
console.log('AAAAAAAAAAAAAAAAAAAAAAAAAAAA');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue