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

How to sort list by date #18

Open
superwebarmy opened this issue Sep 19, 2022 · 1 comment
Open

How to sort list by date #18

superwebarmy opened this issue Sep 19, 2022 · 1 comment

Comments

@superwebarmy
Copy link

Hi, I was wondering if we can sort the list of strings by their creation time or modified time. I'm making the use of cache method which returns list of string but it returns in the random order

@AMuellerAtAHS
Copy link
Contributor

No, actually you can not sort the list of strings by time. Because the strings are only strings and have no information about creation time, modified time or anything else.

You are only able to sort the list with string comparison.

sortedPaths = paths.sort((a,b) => a.compareTo(b));

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

2 participants