Tasks.js
authorAlan Knowles <alan@akbkhome.com>
Sun, 25 Nov 2012 11:28:39 +0000 (19:28 +0800)
committerAlan Knowles <alan@akbkhome.com>
Sun, 25 Nov 2012 11:28:39 +0000 (19:28 +0800)
Tasks.js

index f2f401f..0674862 100644 (file)
--- a/Tasks.js
+++ b/Tasks.js
@@ -160,6 +160,20 @@ Tasks = {
           
          */
         var now = new Date();
+        if ( this.curTask) {
+            var endoftask = this.activeTask.active_datetime.add(Date.HOUR, this.activeTask.qtyvalue);
+            var max_stretch = now.add(Date.HOUR, 1);
+            if (endoftask > max_stretch) {
+                this.fixEndCurrTask();
+            }
+            
+            
+        }
+        
+        
+        
+        
+
         
         if (!this.nextPrompt && this.curTask) {
             //var use_start = this.curTask.active_datetime < now ? now :