mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
Show events until end of month
This commit is contained in:
parent
9e2ea87691
commit
c24eb3205b
2 changed files with 11 additions and 11 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue