Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ninest opened this issue Jul 26, 2020 · 0 comments
Open

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

ninest opened this issue Jul 26, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@ninest
Copy link
Owner

ninest commented Jul 26, 2020

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

@ninest ninest added the bug Something isn't working label Jul 26, 2020
ninest pushed a commit that referenced this issue Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant