feat: book counts

This commit is contained in:
Cory Dransfeldt 2024-05-03 16:18:35 -07:00
parent 5e168c7c79
commit e3e24f2499
No known key found for this signature in database
4 changed files with 11 additions and 2 deletions

View file

@ -225,6 +225,13 @@ export default {
const dateB = DateTime.fromISO(b.dateAdded)
return dateB - dateA
}),
currentBookCount: (books) => {
const year = DateTime.now().year
return books.filter(book => {
if (book.status === 'finished' && book.dateAdded) return parseInt(book.dateAdded.split('-')[0]) === year
return ''
}).length
},
// tags
filterTags: (tags) => {