--- 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 $'
! !