Skip to content

TimeStamps not sorted correctly #18

@khannavidur

Description

@khannavidur

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions