First of all i'm sorry if this is question is not relevant. I'm not familiar with ecma & javascript. I have 2 objects.
I want to merge them and sort with date field. Merging perfectly with .push() But when i'm trying to sort it with add_date value, i'm getting unexpected results.
First Object:
[
    {
        "type": "Sipari\u015f - # PKXLF1",
        "note": "",
        "add_date": "2019-01-07 01:35:25",
        "value": 448.4
    },
    {
        "type": "Sipari\u015f - # PTO3U8",
        "note": "",
        "add_date": "2019-06-25 20:39:44",
        "value": 472
    },
    {
        "type": "Sipari\u015f - # PTYE1M",
        "note": "",
        "add_date": "2019-07-01 09:56:10",
        "value": 1320.77
    },
    {
        "type": "Sipari\u015f - # PXF079",
        "note": "",
        "add_date": "2019-09-06 16:57:09",
        "value": 1859.68
    },
    {
        "type": "Sipari\u015f - # PZ62E5",
        "note": "",
        "add_date": "2019-10-10 18:13:17",
        "value": 755.2
    }
]
And Second Object;
[
    {
        "type": "Tahsilat - Havale \/ Eft",
        "note": "Ziraat Bankas\u0131 Gelen Havale\/EFT",
        "add_date": "2019-01-22 01:35:25",
        "value": 448.4
    },
    {
        "type": "Tahsilat - Havale \/ Eft",
        "note": "Ziraat Bankas\u0131 Gelen Havale\/EFT",
        "add_date": "2019-08-02 20:24:57",
        "value": 1000
    },
    {
        "type": "Tahsilat - Havale \/ Eft",
        "note": "Ziraat Bankas\u0131 Gelen Havale\/EFT",
        "add_date": "2019-10-04 14:48:55",
        "value": 792
    }
]
What i've tried so far;
How to sort an array by a date property
This question's accepted answer
array.sort(function(a,b){
  // Turn your strings into dates, and then subtract them
  // to get a value that is either negative, positive, or zero.
  return new Date(b.date) - new Date(a.date);
});
I've tried but it giving unexpected result like;
0: {type: "Sipariş - # PKXLF1", note: "", add_date: "2019-01-07 01:35:25", value: 448.4}
1: {type: "Sipariş - # PTO3U8", note: "", add_date: "2019-06-25 20:39:44", value: 472}
2: {type: "Sipariş - # PTYE1M", note: "", add_date: "2019-07-01 09:56:10", value: 1320.77}
3: {type: "Sipariş - # PXF079", note: "", add_date: "2019-09-06 16:57:09", value: 1859.68}
4: {type: "Tahsilat - Havale / Eft", note: "Ziraat Bankası Gelen Havale/EFT", add_date: "2019-01-22 01:35:25", value: 448.4}
5: {type: "Tahsilat - Havale / Eft", note: "Ziraat Bankası Gelen Havale/EFT", add_date: "2019-08-02 20:24:57", value: 1000}
What am i missing? Does my add_date field has wrong date values?
Any help greatly appricated!
 
     
     
     
    