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

TimeStamps not sorted correctly #18

Open
khannavidur opened this issue Aug 1, 2018 · 1 comment
Open

TimeStamps not sorted correctly #18

khannavidur opened this issue Aug 1, 2018 · 1 comment

Comments

@khannavidur
Copy link

khannavidur commented Aug 1, 2018

My commit file looks something like -

[
 {
  "lifemoji": "💪",
  "title": "100DaysOfML Challenge Begins",
  "message": "Today I embarked on a challenge to understand and work on Machine Learning",
  "date": "2018-08-01T07:22:43.600Z",
  "id": "49aefe23-ccc3-448c-9bd3-16a96cad39b9"
 },
 {
  "lifemoji": "✅",
  "title": "Downloaded Prof. Gilbert' book",
  "message": "Downloaded \"Introduction to Linear Algebra\" by Gilbert Strang",
  "date": "2018-08-01T08:59:45.823Z",
  "id": "63605e54-faf8-4985-b93a-4d2e1a714447"
 }
]

As per it, "100DaysOfML Challenge Begins" must appear before "Downloaded Prof. Gilbert' book" but that does not happen.

Node JS Version - 8.11.3

I think I found the issue. It' in the gulpfile.js on line 22. It should be

if (new Date(c1.date.input).getTime() < new Date(c2.date.input).getTime()) return -1; 

instead of

if (new Date(c1.date).getTime() < new Date(c2.date).getTime()) return -1;

This resolves it for me.

@khannavidur
Copy link
Author

PR - #19

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

1 participant