Skip to content

Sorting by date doesn't work all the time #1

@ninest

Description

@ninest

Sorting related articles by date is done client-side using a computed property:

// _slug.vue
computed: {
  sortedSimilar() {
    return this.similarArticles.sort((first, second) => {
      return new Date(first.created) < new Date(second.created)
    })
  }
},

However, this only works when the the page is accessed directly. If the page is navigated to, this does not seem to work

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions