AbstractTime.st
changeset 10679 b4dd3412ce74
parent 10485 959ce825c3b7
child 10770 340038ddf158
--- a/AbstractTime.st	Sat Aug 18 16:49:48 2007 +0200
+++ b/AbstractTime.st	Fri Aug 24 15:02:02 2007 +0200
@@ -509,19 +509,22 @@
 
 !AbstractTime methodsFor:'arithmetic'!
 
-+ aNumber
-    "Add aNumber numberOfSeconds"
++ aNumberOrTimeDuration
+    "Add aNumber numberOfSeconds or, if its a timeDuration, add its value"
 
-    ^ self species basicNew 
-        setMilliseconds:(self getMilliseconds + (aNumber * 1000) asInteger)
+    ^ aNumberOrTimeDuration sumFromTimestamp:self.
+
+"/    ^ self species basicNew 
+"/        setMilliseconds:(self getMilliseconds + (aNumberOrTimeDuration * 1000) asInteger)
 
     "
      Timestamp now to:(Timestamp now + 30) by:2 do:[:time|
         Transcript showCR:time.
      ].
 
-     (Timestamp now + 20)  -  Timestamp now 
-     (Timestamp now + 0.5)  -  Timestamp now 
+     (Timestamp now + 20)  -  Timestamp now  
+     (Timestamp now + 0.5)  -  Timestamp now  
+     (Timestamp now + (TimeDuration fromString:'1m 10s'))  -  Timestamp now  
     "
 !
 
@@ -1074,5 +1077,5 @@
 !AbstractTime class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.55 2007-04-02 10:16:02 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.56 2007-08-24 13:02:02 sr Exp $'
 ! !