HistoryManager.st
changeset 2103 61e20ffc4ddf
parent 2102 c8a7c7f580a8
child 2317 d62da5a37fc3
--- a/HistoryManager.st	Fri Jul 31 10:36:17 2009 +0200
+++ b/HistoryManager.st	Wed Aug 12 20:50:39 2009 +0200
@@ -800,24 +800,24 @@
 convertStringToDate: aString
     "kludge"
 
-    | s day month year coll |
+    | day month year words |
 
     "delete delimiter from the date string"
-    coll := aString asCollectionOfSubstringsSeparatedByAny:'.-/'.
+    words := aString asCollectionOfSubstringsSeparatedByAny:'.-/'.
 
-    day := (coll at: 1) asNumber.
-    month := Number readFrom:(coll at: 2 ) onError:nil.
+    day := Number readFromString:(words at: 1).
+    month := Number readFrom:(words at: 2 ) onError:nil.
     month isNil ifTrue:[
-        month := Date indexOfMonth:(coll at:2) language:#en.
+        month := Date indexOfMonth:(words at:2) language:#en.
         month == 0 ifTrue:[
-            month := Date indexOfMonth:(coll at:2).
+            month := Date indexOfMonth:(words at:2).
         ].
         month == 0 ifTrue:[
             self halt:'invalid month in history line'.
             ^ Date today.
         ].
     ].
-    year := (coll at: 3 ) asNumber.
+    year := Number readFromString:(words at: 3 ).
 
     (year between:0 and:99) ifTrue:[
         year := UserPreferences current twoDigitDateHandler value:year.
@@ -825,9 +825,9 @@
     ^ Date newDay:day month:month year:year.
 
     "
-     HistoryLine convertAStringToADate:'18.10.1995'
-     HistoryLine convertAStringToADate:'18.10.95'    
-     HistoryLine convertAStringToADate:'18.10.01'    
+     HistoryLine convertStringToDate:'18.10.1995'
+     HistoryLine convertStringToDate:'18.10.95'    
+     HistoryLine convertStringToDate:'18.10.01'    
     "
 
     "Modified: / 23-08-1995 / 21:28:58 / robert"
@@ -844,7 +844,7 @@
     h := Number readFromString:(aString copyFrom:1 to:2) onError:[^ Time now].
     m := Number readFromString:(aString copyFrom:4 to:5) onError:[^ Time now].
     aString size >= 8 ifTrue:[
-        s := (aString copyFrom:7 to:8) asNumber.
+        s := Number readFromString:(aString copyFrom:7 to:8).
     ] ifFalse:[
         s := 0.
     ].
@@ -908,7 +908,7 @@
 !
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.71 2009-07-31 08:36:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.72 2009-08-12 18:50:39 cg Exp $'
 ! !
 
 !HistoryManager::HistoryLine class methodsFor:'filtering'!
@@ -1525,7 +1525,7 @@
 !HistoryManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.71 2009-07-31 08:36:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.72 2009-08-12 18:50:39 cg Exp $'
 ! !
 
 HistoryManager initialize!