                 return finishedOn
             }
             else {
-                return NSDate()
+                return taskViewController.result.endDate ?? NSDate()
             }
         }()
         
-        if (schedule.startedOn == nil) {
-            schedule.startedOn = taskViewController.result.results?.first?.startDate ?? schedule.finishedOn
-        }
+        schedule.startedOn = taskViewController.result.startDate ?? schedule.finishedOn
         
         // Send message to server
         SBAUserBridgeManager.updateScheduledActivity(schedule)

            // to be able to handle. Currently, that means only taskReference activities with an identifier that
            // maps to a known task.
            self.activities = scheduledActivities.filter({ (activity) -> Bool in
                guard (activity.activity.task != nil), let taskRef = self.bridgeInfo.taskReferenceWithIdentifier(activity.activity.task.identifier) else {
                    return false
                }
                self.taskReferenceMap[activity.guid] = taskRef
                return true
            })
            
            // reload table


public class SBAActivityTableViewController: UITableViewController, SBASharedInfoController, ORKTaskViewControllerDelegate {
    
    private var activities: [SBBScheduledActivity] = []
    
    override public func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        self.reloadData()
    }
    
    // MARK: Customizable implementations
    
