On 07 Jun 2013, at 13:26, José Comesaña <[email protected]> wrote:

> Thank you Sven.
> 
> I had made the fixes myself, creating a new class for dates (I don't need the 
> complexity of Date just for determining if a date is past, I don't need date 
> arithmetic either). I just wanted to inform, mainly because the bug seems to 
> be still present in Pharo 3.0.
> 
> Anyway, your solution does not work for the 'd/m/y' pattern, although it does 
> for 'd/m/yy'.

Depends on what a single y means, right ?

> I could write the tests you suggest, if you think they are interesting. 

Yes, please do: with a good set of tests, we can discuss using concrete 
examples. 

> Regards
> 
> 2013/6/7 Sven Van Caekenberghe <[email protected]>
> Hi José,
> 
> On 07 Jun 2013, at 12:02, José Comesaña <[email protected]> wrote:
> 
> > Hello everybody.
> >
> > I would like to add a new improvement to this thread.
> >
> > I have noticed that Date class has a bug, or at least something to improve 
> > in readFrom:pattern: method. The initial comment states that "A year given 
> > using only two decimals is considered to be >2000.".
> >
> > But this seems to be incorrect: if you evaluate
> >
> > Date readFrom: '07/06/13' readStream pattern: 'd/m/y'
> >
> > you get:
> >
> >  7 June 0013     instead of  7 June 2013.
> >
> > I am working with version #20605
> 
> The fix would be quite easy:
> 
>   year := (inputStream next: 2) asInteger
> 
> should be
> 
>   year := 2000 + (inputStream next: 2) asInteger
> 
> A more important problem is that there are no users of #readFrom:pattern: in 
> the system, not even unit tests. If we want to keep the methods, someone 
> should start by writing a couple of unit tests.
> 
> Sven
> 
> > Thank you all for your great work.
> >
> > Regards.
> >
> >
> > 2013/6/6 Camillo Bruni <[email protected]>
> > can you save an image with the inspector opened on both x and y, x asTime 
> > and y asTime
> > and provide a link to it? like that I can inspect it in all detail...
> >
> > On 2013-06-06, at 17:51, dmacq <[email protected]> wrote:
> >
> > > I tried it again this morning and still had the problem.
> > >
> > > This is interesting.
> > >
> > > | x y |
> > > x := DateAndTime year: 1991 day: 196 hour: 20 minute: 5 second: 7.
> > > y := DateAndTime year: 1991 month: 7 day: 15 hour: 20 minute: 5 second: 7.
> > > x = y  <------------------ True
> > >
> > > But
> > > | x y |
> > > x := DateAndTime year: 1991 day: 196 hour: 20 minute: 5 second: 7.
> > > y := DateAndTime year: 1991 month: 7 day: 15 hour: 20 minute: 5 second: 7.
> > > x asTime = y asTime <------------- False
> > >
> > >
> > >
> > > --
> > > View this message in context: 
> > > http://forum.world.st/DateAndTime-asTime-tp4691870p4691988.html
> > > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> > >
> >
> >
> >
> 
> 
> 


Reply via email to