node.js按键对JSON排序,该键采用日期格式

我正在尝试使用node.js,目前正在尝试可视化汇率的发展,我从API获取数据,现在尝试按日期对它们进行排序。

我在响应中获得的数据如下所示:

{
    "rates": {
        "2001-03-07": {
            "CZK": 34.888
        },
        "2018-10-09": {
            "CZK": 25.805
        },
        "2002-08-15": {
            "CZK": 31.307
        },
        "2011-12-07": {
            "CZK": 25.328
        }
    },
    "start_at": "1999-01-01",
    "base": "EUR",
    "end_at": "2020-05-21"
}

Could anyone please explain to me what does this: "2001-03-07": {"CZK": 34.888} mean? I understand that "2001-03-07" is a key, but I am not sure about {"CZK": 34.888}, I understand it is an another object which is just a value to the "2001-03-07" key. Is this correct?

如果是这样,我该如何排序?

我想按以下顺序获取数据:

    "rates": {
        "2001-03-07": {
            "CZK": 34.888
        },
        "2002-08-15": {
            "CZK": 31.307
        },
        "2011-12-07": {
            "CZK": 25.328
        },
        "2018-10-09": {
            "CZK": 25.805
        }
    }

我发现了很多有关如何按值排序的信息,而很少有关于按键排序的信息,但是对我来说真正没有用,这是否可能?如果是这样,怎么做?

这是我当前的代码:

const http = require('https');

var options = {
  host: 'api.exchangeratesapi.io',
  path: '/history?start_at=1999-01-01&end_at=2020-05-21&base=EUR&symbols=CZK'
};

callback = function(response) {
  var str = '';
  var fullData = '';
  var filteredData = [];

  response.on('data', function (chunk) {
    str += chunk;
  });

  response.on('end', function () {
    fullData = JSON.parse(str);
    filteredData.push(fullData.rates);

    function custom_sort(a, b) {
        return new Date(a.rates).getTime() - new Date(b.rates).getTime();
    }

    let testing = filteredData.sort(custom_sort);

    console.log(testing);

  });
}

http.request(options, callback).end();

谢谢