     }
 
     /*
+     * public func durationLeft(date:NSDate) -> Int
+     * - Detemines the schedulable duration left until date in seconds
+     * [Return]
+     * Int - Schedulable duration until date
+    */
+    public func durationLeft(date:NSDate) -> Int
+    {
+        //Prepare Data
+        let arr_drsn = self.generateSchedulableDuration()
+        var rst_drsn = 0
+
+        for drsn in arr_drsn
+        {
+            if drsn.begin.compare(date as Date) == ComparisonResult.orderedDescending
+            {
+                //Duration begin > date
+                break
+            }
+            else if drsn.begin.compare(date as Date) == ComparisonResult.orderedAscending && Date(timeInterval: TimeInterval(drsn.duration), since: drsn.begin as Date).compare(date as Date) == ComparisonResult.orderedDescending
+            {
+                //Duration begin < date < Durationbegin + duration
+                //Duration between Duration begin and date
+                rst_drsn += Int(round(date.timeIntervalSince(drsn.begin as Date)))
+            }
+            else
+            {
+                //Full Duration
+                rst_drsn += drsn.duration
+            }
+        }
+
+        return rst_drsn
+    }
+
+    /*
      * public func generateSubtask(task:PVRTask) -> [PVRTask]
      * - Generate subtasks from task
      * [Return]

public enum PVRSchedulerError:Error
{
    case DurationOverflow /* Schedulable duration is insufficent to schedule all tasks*/
}



        self.dataView.loadFromDB()
        var date = Date()
        var task = self.dataViewCtrl.sortedTask(sattr: PVRTaskSort.deadline)[0] //Closest Deadline
        var sch_stsk = Dictionary<String,Array<PVRTask>>()

        //Iterate Tasks
        while date.compare(self.lastTaskDate() as Date) != ComparisonResult.orderedDescending && self.dataView.task.count > 0
