Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Organize languages in dropdown by alphabet order #57

Closed
mmahalwy opened this issue Jul 30, 2015 · 6 comments
Closed

Organize languages in dropdown by alphabet order #57

mmahalwy opened this issue Jul 30, 2015 · 6 comments

Comments

@mmahalwy
Copy link
Contributor

No description provided.

@haritsE
Copy link
Contributor

haritsE commented Aug 23, 2016

Hey guys, is this issue still available? Can I try it? By languages, did you mean this one? alt text

@mmahalwy
Copy link
Contributor Author

@haritsE yes, still a bug! Please do take it on. I'd suggest opening a PR early so it's marked on this issue as in progress.

@thabti
Copy link
Contributor

thabti commented Aug 25, 2016

Example of sorting alphabetically on objects within an array:

export function alphabetically(property) {

  return (a, b) => {
    const textA = a[property].toUpperCase();
    const textB = b[property].toUpperCase();

    if (textA < textB) {
      return -1;
    }

    if (textA > textB) {
      return 1;
    }

    return 0;
  };
}

usage:

 [{name: "English"}, {name: "Arabic"}].sort(alphabetically('name')

@haritsE
Copy link
Contributor

haritsE commented Aug 25, 2016

Awesome, I'll try to have a PR ready by this weekend 👍

@kriwil
Copy link

kriwil commented Dec 8, 2016

I guess this issue is fixed?

@thabti
Copy link
Contributor

thabti commented Dec 8, 2016

@kriwil yep

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

No branches or pull requests

5 participants