I am trying to print a table of staff members and their shifts for given week.
I receive data in following format from the api.
[
{
full_name: 'Staff 1',
schedule: [
{
day_of_week: 'tuesday',
shifts: [
{
time_start: '9:00am',
time_end: '6:00pm'
}
]
},
{
day_of_week: 'wednesday',
shifts: [
{
time_start: '9:00am',
time_end: '6:00pm'
}
]
},
]
},
{
full_name: 'Staff 2',
schedule: [
{
day_of_week: 'tuesday',
shifts: [
{
time_start: '9:00am',
time_end: '5:00pm'
}
]
},
{
day_of_week: 'thursday',
shifts: [
{
time_start: '9:00am',
time_end: '5:00pm'
}
]
}
]
}
]
I also have given week like '2021-05-09' to '2021-05-15'.
How can I display their shift time in html table?
Result I want to achieve is the following table in picture with empty cell if that staff is not working on that day of the week and if working then time_start - time_end.
Thank you
