Issues reformatting old google map opening times to new ones

I am currently importing data from the Google api, but getting inconsistent opening hour times.

This was the original type I was receiving:

[
  { close: { day: 0, time: '1600' }, open: { day: 0, time: '1000' } },
  { close: { day: 1, time: '2000' }, open: { day: 1, time: '0830' } },
  { close: { day: 2, time: '2000' }, open: { day: 2, time: '0830' } },
  { close: { day: 3, time: '2000' }, open: { day: 3, time: '0830' } },
  { close: { day: 4, time: '2000' }, open: { day: 4, time: '0830' } },
  { close: { day: 5, time: '2000' }, open: { day: 5, time: '0830' } },
  { close: { day: 6, time: '1700' }, open: { day: 6, time: '0900' } }
]

But now and then I get this format.

{
  Monday: '9AM–5PM',
  Tuesday: '9AM–5PM',
  Wednesday: '9AM–5PM',
  Thursday: '9AM–5PM',
  Friday: '9AM–5PM',
  Saturday: 'Closed',
  Sunday: 'Closed'
}

I’ve spent ages trying to reformat the second format into the first and original format so it is all consistent, but have been very unsuccessful in doing so…

Can anyone help me? I also have Lowdash/Underscore, but again, cannot figure this one out… I thought maybe someone might have already been doing something similar too.