'Set start and end time for given operation. If first operation, set start as
`planned_start_date`, else add time diff to end time of earlier operation.'

def set_start_end_time_for_workstation(self, data, index):

    if (index == 0):
        data.planned_start_time = self.planned_start_date
    else:
        data.planned_start_time = (get_datetime(self.operations[(index - 1)].planned_end_time) + get_mins_between_operations())
    data.planned_end_time = (get_datetime(data.planned_start_time) + relativedelta(minutes=data.time_in_mins))
    if (data.planned_start_time == data.planned_end_time):
        frappe.throw(_(u'Capacity    Planning    Error'))
