Need to merge two objects into one object array by comparing with JavaScript/AngularJS.
A = [
{date: "2013-07-31", start_time:"2013-07-31 17:30:00+10", finish_time:"2013-07-31 20:30:00+10"},
{date: "2013-08-03", start_time:"2013-08-03 17:00:00+10", finish_time:"2013-08-03 20:00:00+10"},
{date: "2013-09-03", start_time:"2013-09-03 17:00:00+10", finish_time:"2013-09-03 20:00:00+10"}
]
B = [
{date: "2013-07-31", start_time:"2013-07-31 17:37:49+10", finish_time:"2013-07-31 20:32:04+10"},
{date: "2013-08-03", start_time:"2013-08-03 16:57:34+10", finish_time:"2013-08-03 20:00:57+10"}
]
Expected output
C = [
{date: "2013-07-31", start_time:"late", finish_time:"on time"},
{date: "2013-08-03", start_time:"on time", finish_time:"on time"},
]
Comparison process involves checking for same date, then comparing start times. If B's start_time exceeds A's start_time, it will be labeled as "late". Similarly, if B's finish_time is lower than A's, it will be marked as "too early".