checkin from browser
authorClaus Gittinger <cg@exept.de>
Fri, 25 Jun 1999 16:35:06 +0200
changeset 1191 fdc4454013e4
parent 1190 91cf6653901e
child 1192 6db390e6463e
checkin from browser
PrintConv.st
PrintConverter.st
--- a/PrintConv.st	Sat Jun 19 00:52:33 1999 +0200
+++ b/PrintConv.st	Fri Jun 25 16:35:06 1999 +0200
@@ -309,6 +309,12 @@
     aTypeSymbol == #date ifTrue:[
         self initForDate
     ].
+    aTypeSymbol == #time ifTrue:[
+        self initForTime
+    ].
+    aTypeSymbol == #timeOrNil ifTrue:[
+        self initForTimeOrNil
+    ].
     aTypeSymbol == #float ifTrue:[
         self initForFloat
     ].
@@ -416,6 +422,22 @@
     stringToValueBlock := [:string | string]
 !
 
+initForTime
+    "initialize to convert to/from a time 
+     - if the string is empty or invalid, convert to the current time"
+
+    valueToStringBlock := [:time | time printString].
+    stringToValueBlock := [:string | Time readFromString:string onError:[Time now]]
+!
+
+initForTimeOrNil
+    "initialize to convert to/from a time 
+     - if the string is empty or invalid, convert to nil"
+
+    valueToStringBlock := [:time | time printString].
+    stringToValueBlock := [:string | Time readFromString:string onError:nil]
+!
+
 initForYesNo
     "initialize to convert a 'yes'/'no' string to/from a boolean 
      The string is supposed to be in the current Language
@@ -441,5 +463,5 @@
 !PrintConverter class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/Attic/PrintConv.st,v 1.16 1997-02-11 19:08:41 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/Attic/PrintConv.st,v 1.17 1999-06-25 14:35:06 cg Exp $'
 ! !
--- a/PrintConverter.st	Sat Jun 19 00:52:33 1999 +0200
+++ b/PrintConverter.st	Fri Jun 25 16:35:06 1999 +0200
@@ -309,6 +309,12 @@
     aTypeSymbol == #date ifTrue:[
         self initForDate
     ].
+    aTypeSymbol == #time ifTrue:[
+        self initForTime
+    ].
+    aTypeSymbol == #timeOrNil ifTrue:[
+        self initForTimeOrNil
+    ].
     aTypeSymbol == #float ifTrue:[
         self initForFloat
     ].
@@ -416,6 +422,22 @@
     stringToValueBlock := [:string | string]
 !
 
+initForTime
+    "initialize to convert to/from a time 
+     - if the string is empty or invalid, convert to the current time"
+
+    valueToStringBlock := [:time | time printString].
+    stringToValueBlock := [:string | Time readFromString:string onError:[Time now]]
+!
+
+initForTimeOrNil
+    "initialize to convert to/from a time 
+     - if the string is empty or invalid, convert to nil"
+
+    valueToStringBlock := [:time | time printString].
+    stringToValueBlock := [:string | Time readFromString:string onError:nil]
+!
+
 initForYesNo
     "initialize to convert a 'yes'/'no' string to/from a boolean 
      The string is supposed to be in the current Language
@@ -441,5 +463,5 @@
 !PrintConverter class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/PrintConverter.st,v 1.16 1997-02-11 19:08:41 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/PrintConverter.st,v 1.17 1999-06-25 14:35:06 cg Exp $'
 ! !