I want to build certain UI, it involves manipulation of array object, I know the pseudo code, but I don't know how to produce the output. Below is my case statement. Need guidance.
if outer date is in between of data's date_from and date_to
[{
date:'2017-05-11',
data:[{id: 2, name: 'abc', date_from:'2017-05-03', date_to:'2017-05-05'}]
}]
set type to mid
[{
date:'2017-05-11',
data:[{id: 2, name: 'abc', date_from:'2017-05-03', date_to:'2017-05-05', type:'mid'}]
}]
if outer date is equal to date_from
[{
date:'2017-05-11',
data:[{id: 2, name: 'abc', date_from:'2017-05-11', date_to:'2017-05-15'}]
}]
set type to is_start_left
if outer date is equal to date_to
[{
date:'2017-05-11',
data:[{id: 2, name: 'abc', date_from:'2017-05-01', date_to:'2017-05-11'}]
}]
set type to is_end_right