small improvement

This commit is contained in:
2023-04-29 19:45:06 +02:00
parent cca2ad3a66
commit 4ed786d5ad
2 changed files with 5 additions and 2 deletions

View File

@@ -62,7 +62,10 @@ const references = computed<Note[]>(() => {
</div>
<hr class="my-3" />
<div class="flex text-sm text-secondary">
<span>{{ note.wordCount }} words</span>
<span
>{{ note.wordCount }}
{{ note.wordCount === 1 ? 'word' : 'words' }}</span
>
<span class="ml-auto">Last modified {{ formatDate(note.modified) }}</span>
</div>
</div>

View File

@@ -12,7 +12,7 @@ export const notes = computed<Note[]>(() => {
return Object.entries(baseNotes)
.map(([_, note]) => ({
...note,
wordCount: note.content.split(' ').length,
wordCount: note.content.split(' ').length - 1,
}))
.sort((a, b) => b.modified - a.modified) as Note[]
})