Mantis - Squeak
Viewing Issue Advanced Details
7274 Kernel major always 01-25-09 11:27 01-25-09 11:37
lucian3  
 
normal  
new  
open  
none    
none  
0007274: Date class>>fromString: cannot handle dates that contain a day name or day abbreviation at the beginning (FIX)
Date class>>fromString: and TimeStamp class>>fromString: (the latter uses the former) cannot handle date strings that contain a day name or abbreviation at the beginning offset by a period, comma or whitespace as is common in many date formats.
 Date class-readFrom.st [^] (1,367 bytes) 01-25-09 11:27
 Date class-skipDayName.st [^] (638 bytes) 01-25-09 11:28
 DateTest-testReadFrom.st [^] (552 bytes) 01-25-09 11:28
 Date class-readFrom7274.st [^] (1,367 bytes) 01-25-09 11:30
 Date class-skipDayName7274.st [^] (638 bytes) 01-25-09 11:31
 DateTest-testReadFrom7274.st [^] (552 bytes) 01-25-09 11:31

Notes
(0012935)
lucian3   
01-25-09 11:37   
The first file modifies readFrom: to call #skipDayName: if the date begins with a letter. The second file contains #skipDayName:, which will remove a sequence of letters from the stream and see if it matches a valid day name or abbreviation. If not, it will push it back onto the stream.

The third file modifies the readFrom: test case to test dates with day names/abbreviations in them. I replaced the multiple nearly identical #assert: statements with iteration.