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

withSort not sorting properly #235

Closed
Melindrea opened this issue Nov 11, 2016 · 3 comments
Closed

withSort not sorting properly #235

Melindrea opened this issue Nov 11, 2016 · 3 comments

Comments

@Melindrea
Copy link
Contributor

When I have two posts with posted as part of the metadata, one posted 28/3 2016, the other posted 14/2 2016, it puts the 28/3 one at the very bottom.

The answer was to replace return a > b with

if(a > b){
          return 1;
    } else if (a < b) {
          return -1;
    }
    return 0;

on line https://github.com/assemble/handlebars-helpers/blob/master/lib/array.js#L604
I saw suggestions that someone else had gotten a similar pull request merged in, but that does not seem to there in version ^0.7.5 which is what I got when I installed it via NPM.

An oversight somewhere?

@assemblebot
Copy link

@Melindrea Thanks for the issue! If you're reporting a bug, please be sure to include:

  • The version of assemble you are using.
  • Your assemblefile.js (This can be in a gist)
  • The commandline output. (Screenshot or gist is fine)
  • What you expected to happen instead.

@LaurentGoderre
Copy link
Contributor

@doowb @jonschlinkert this would be fixed by bumping the version to 0.8.1 (this commit fixes it 0ad46f8)

@doowb
Copy link
Member

doowb commented Mar 31, 2017

fixed and published in 0.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants