mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 16:27:31 -04:00 
			
		
		
		
	Working on the time tracker
This commit is contained in:
		
							parent
							
								
									f20956732a
								
							
						
					
					
						commit
						fc624d1aab
					
				| @ -983,7 +983,7 @@ | ||||
|                 duration = Math.floor(duration / 100) / 10; | ||||
|             } else { | ||||
|                 self.time_log().forEach(function(time){ | ||||
|                     duration += time.duration(); | ||||
|                     duration += time.duration.running(); | ||||
|                 }); | ||||
|             } | ||||
| 
 | ||||
| @ -1173,6 +1173,19 @@ | ||||
|         }); | ||||
| 
 | ||||
|         self.duration = ko.computed({ | ||||
|             read: function () { | ||||
|                 model.clock(); // bind to the clock
 | ||||
|                 if (! self.startTime() || ! self.endTime()) { | ||||
|                     return false; | ||||
|                 } | ||||
|                 return self.endTime() - self.startTime(); | ||||
|             }, | ||||
|             write: function(value) { | ||||
|                 self.endTime(self.startTime() + value); | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
|         self.duration.running = ko.computed({ | ||||
|             read: function () { | ||||
|                 model.clock(); // bind to the clock
 | ||||
|                 if (! self.startTime()) { | ||||
| @ -1185,6 +1198,8 @@ | ||||
|                 self.endTime(self.startTime() + value); | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| </script> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user