I'm working on a week calendar and to store appointments in DB I store them as scalar DateTime. The calendar that I'm working with only works with moment objects. I found that I can parse the DateTime as moment objects like this --> moment('2020-06-12T09:00:00.014Z'). I'm just wondering how I could efficiently reformat the appointmentToRender array so that start and end are no longer just DateTime's but moment object before passing the appointmentToRender array to <WeekCalendar />
appointmentToRender array structure:
appointmentToRender
(2) [{…}, {…}]
0: {start: "2020-06-12T08:00:00.316Z", end: "2020-06-12T09:22:00.316Z", __typename: "Appointment"}
1: {start: "2020-06-14T09:00:00.390Z", end: "2020-06-14T10:22:00.390Z", __typename: "Appointment"}
length: 2
__proto__: Array(0)