Show events until end of month

This commit is contained in:
les 2021-03-08 14:38:47 +01:00
parent 9e2ea87691
commit c24eb3205b
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 11 additions and 11 deletions

View file

@ -27,14 +27,12 @@ export default {
const month = dayjs().month() + 1
const year = dayjs().year()
return {
page: { month, year },
attributes: []
page: { month, year }
}
},
computed: mapState(['tags', 'filters', 'in_past', 'settings']),
methods: {
...mapActions(['updateEvents', 'showPastEvents']),
updateAttributes () {
computed: {
...mapState(['tags', 'filters', 'in_past', 'settings']),
attributes () {
const colors = ['blue', 'orange', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray']
const tags = take(this.tags, 10).map(t => t.tag)
let attributes = []
@ -68,12 +66,14 @@ export default {
dates: { start: new Date(e.start_datetime * 1000), end: new Date(e.end_datetime * 1000) }
})))
this.attributes = attributes
},
return attributes
}
},
methods: {
...mapActions(['updateEvents', 'showPastEvents']),
updatePage (page) {
return new Promise((resolve, reject) => {
this.$emit('monthchange', page)
this.updateAttributes()
})
},
click (day) {

View file

@ -126,8 +126,8 @@ export default {
this.date = ''
this.start = dayjs().year(year).month(month - 1).startOf('month').unix() // .startOf('week').unix()
}
// this.end = dayjs().year(year).month(month - 1).endOf('month').unix() // .endOf('week').unix()
this.end = null
// TODO: check if calendar view is double
this.end = dayjs().year(year).month(month).endOf('month').unix() // .endOf('week').unix()
this.updateEvents()
},
dayChange (day) {