title: Filter date range from object with date as key in Ruby
body: <p>I am using the AlphaVantage API (<a href="https://www.alphavantage.co/documentation/#daily" rel="nofollow noreferrer">https://www.alphavantage.co/documentation/#daily</a>) to get daily stock data. Unfortunately the API does not offer the option to get only data for a specific date range. It returns always all data from the last 20 years. The hash it returns contains the date as a key:</p>
  
  <pre><code> "2016-12-08": {
          "1. open": "61.3000",
          "2. high": "61.5800",
          "3. low": "60.8400",
          "4. close": "61.0100",
          "5. volume": "21220753"
      },
      "2016-12-07": {
          "1. open": "60.0100",
          "2. high": "61.3800",
          "3. low": "59.8000",
          "4. close": "61.3700",
          "5. volume": "30808969"
      },
      "2016-12-06": {
          "1. open": "60.4300",
          "2. high": "60.4600",
          "3. low": "59.8000",
          "4. close": "59.9500",
          "5. volume": "19907035"
      },
  </code></pre>
  
  <p>How can I select only the entries for a give time range, eg. 2016-12-01 until 2016-12-10? I understand that I always will get the full data and will have do to the filtering on the returned hash.</p>