How to parse JSON with datestamp outside object into each object, and create an array : <p>Server returns JSON data, I would like to insert the datestamp before each nested object into each object, then delete the datestamp outside of each object.  </p>

<p>Then, I would like to put all inner objects inside of an array.</p>

<p>Is there a way to do this with JSON.parse or otherwise?</p>

<p>Thank-you</p>

<p>This is what the JSON data looks like after it's parsed:</p>

<pre><code>{ '2019-09-30 16:00:00':
   { '1. apples': '13',
     '2. oranges': '12',
     '3. peaches': '15',
     '4. cherries': '14',
     '5. onions': '43' },
  '2019-09-30 15:59:00':
   { '1. apples': '42',
     '2. oranges': '43',
     '3. peaches': '34',
     '4. cherries': '64',
     '5. onions': '45' },
}
</code></pre>

<p>This is what I would like it to look like after moving the datestamps into each trailing object, and wrapping all objects into an array.  The actual data is many thousands of objects:</p>

<pre><code>{ [ { 'date': '2019-09-30 16:00:00',
     '1. apples': '13',
     '2. oranges': '12',
     '3. peaches': '15',
     '4. cherries': '14',
     '5. onions': '43' },
    { 'date': '2019-09-30 15:59:00'
     '1. apples': '42',
     '2. oranges': '43',
     '3. peaches': '34',
     '4. cherries': '64',
     '5. onions': '45' },
] }
</code></pre>

<p>I hope to get it looking like the second set of data.  Thank-you</p>
