Firefox sorting by date issue

Posted by Tim Borodin on 02/11/2021
Firefox sorting by date issue

Just found this weird behavior of different browsers...
Had problems sorting posts by date in Firefox, but Chrome worked alright.
Apparently firefox didn't understand dates in format 11-02-2021, but needed 11/02/2021.




This is the 4th and the longes post that I've made

Posted by Tim Borodin on 02/02/2021
This is the 4th and the longes post that I've made

This is my Fourth blog post.
Added some About me data, and sorting by created date. Newest posts at the top.
Blow is the code that executes sorting:

    data.allMarkdownRemark.edges
    .sort((a, b) => {
            const aDate = new Date(a.node.frontmatter.date);
         



This is my post number 3

Posted by Mara Borodin on 01/30/2021
This is my post number 3

This is my third blog post in Gatsby.




Second Gatsby post

Posted by John Doe on 01/11/2021
Second Gatsby post

This is my second blog post in Gatsby.




My first Gatsby post

Posted by Tim Borodin on 01/02/2021
My first Gatsby post

This is my very first blog post in Gatsby.