Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/store/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
},
getters: {
assignedCardsDashboard: state => {
return Object.values(state.assignedCards).flat()
return state.assignedCards
},
},
mutations: {
Expand Down
9 changes: 1 addition & 8 deletions src/views/DashboardToday.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,7 @@ export default {
'assignedCardsDashboard',
]),
cards() {
const today = new Date()
const list = [
...this.assignedCardsDashboard,
].filter((card) => {
return card.duedate !== null
}).filter((card) => {
return (new Date(card.duedate)).getDate() === (new Date(today)).getDate()
})
const list = [...this.assignedCardsDashboard.today || []]
list.sort((a, b) => {
return (new Date(a.duedate)).getTime() - (new Date(b.duedate)).getTime()
})
Expand Down
10 changes: 1 addition & 9 deletions src/views/DashboardTomorrow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,7 @@ export default {
'assignedCardsDashboard',
]),
cards() {
const tomorrow = new Date()
tomorrow.setDate(tomorrow.getDate() + 1)
const list = [
...this.assignedCardsDashboard,
].filter((card) => {
return card.duedate !== null
}).filter((card) => {
return (new Date(card.duedate)).getDate() === (new Date(tomorrow)).getDate()
})
const list = [...this.assignedCardsDashboard.tomorrow || []]
list.sort((a, b) => {
return (new Date(a.duedate)).getTime() - (new Date(b.duedate)).getTime()
})
Expand Down
9 changes: 4 additions & 5 deletions src/views/DashboardUpcoming.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ export default {
'assignedCardsDashboard',
]),
cards() {
const list = [
...this.assignedCardsDashboard,
].filter((card) => {
return card.duedate !== null
})
const list = Object.values(this.assignedCardsDashboard).flat()
.filter((card) => {
return card.duedate !== null
})
list.sort((a, b) => {
return (new Date(a.duedate)).getTime() - (new Date(b.duedate)).getTime()
})
Expand Down
Loading