mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +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 month = dayjs().month() + 1
|
||||||
const year = dayjs().year()
|
const year = dayjs().year()
|
||||||
return {
|
return {
|
||||||
page: { month, year },
|
page: { month, year }
|
||||||
attributes: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: mapState(['tags', 'filters', 'in_past', 'settings']),
|
computed: {
|
||||||
methods: {
|
...mapState(['tags', 'filters', 'in_past', 'settings']),
|
||||||
...mapActions(['updateEvents', 'showPastEvents']),
|
attributes () {
|
||||||
updateAttributes () {
|
|
||||||
const colors = ['blue', 'orange', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray']
|
const colors = ['blue', 'orange', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray']
|
||||||
const tags = take(this.tags, 10).map(t => t.tag)
|
const tags = take(this.tags, 10).map(t => t.tag)
|
||||||
let attributes = []
|
let attributes = []
|
||||||
|
@ -68,12 +66,14 @@ export default {
|
||||||
dates: { start: new Date(e.start_datetime * 1000), end: new Date(e.end_datetime * 1000) }
|
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) {
|
updatePage (page) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.$emit('monthchange', page)
|
this.$emit('monthchange', page)
|
||||||
this.updateAttributes()
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
click (day) {
|
click (day) {
|
||||||
|
|
|
@ -126,8 +126,8 @@ export default {
|
||||||
this.date = ''
|
this.date = ''
|
||||||
this.start = dayjs().year(year).month(month - 1).startOf('month').unix() // .startOf('week').unix()
|
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()
|
// TODO: check if calendar view is double
|
||||||
this.end = null
|
this.end = dayjs().year(year).month(month).endOf('month').unix() // .endOf('week').unix()
|
||||||
this.updateEvents()
|
this.updateEvents()
|
||||||
},
|
},
|
||||||
dayChange (day) {
|
dayChange (day) {
|
||||||
|
|
Loading…
Reference in a new issue