BUG: Time<<fromString:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

BUG: Time<<fromString:

Christopher J. Demers
Time fromString: does not accept "12:00 AM" as a valid time.

"Error"
Time fromString: '12:00 AM'

"Works"
Time fromString: '00:00AM'

"Works"
Time fromString: '00:00'


Reply | Threaded
Open this post in threaded view
|

Re: Time<<fromString:

Paul Kelly
on a flyer ....  But there is a space between "12:00" and the "AM" but not
for the "00:00AM"

Could this be it?


"Christopher J. Demers" <[hidden email]> wrote in
message news:9ecos3$25ep2$[hidden email]...

> Time fromString: does not accept "12:00 AM" as a valid time.
>
> "Error"
> Time fromString: '12:00 AM'
>
> "Works"
> Time fromString: '00:00AM'
>
> "Works"
> Time fromString: '00:00'
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Time<<fromString:

Don Rylander
I think you'll find the problem occurs in the Time class>>readFrom: method.
(Try stepping through it from a workspace using F11--what a great feature!)
Once it determines that it's an AM time, it checks the hours to make sure that
it's included in the range from 0 to 11.  If that range is from 0 to 12
instead, it seems to work fine, since the way it deals with the hours later in
the method (i.e., hh % 12) if there is a marker, avoids any ill effects.  Of
course, that's pretty much with no testing to speak of.

Don


"Paul Kelly" <[hidden email]> wrote in message
news:9eecni$a4f$[hidden email]...

> on a flyer ....  But there is a space between "12:00" and the "AM" but not
> for the "00:00AM"
>
> Could this be it?
>
>
> "Christopher J. Demers" <[hidden email]> wrote in
> message news:9ecos3$25ep2$[hidden email]...
> > Time fromString: does not accept "12:00 AM" as a valid time.
> >
> > "Error"
> > Time fromString: '12:00 AM'
> >
> > "Works"
> > Time fromString: '00:00AM'
> >
> > "Works"
> > Time fromString: '00:00'
> >
> >
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Time<<fromString:

Christopher J. Demers
In reply to this post by Paul Kelly
Paul Kelly <[hidden email]> wrote in message
news:9eecni$a4f$[hidden email]...
> on a flyer ....  But there is a space between "12:00" and the "AM" but not
> for the "00:00AM"
>
> Could this be it?

No, the spaces do not matter.  Don's explanation bellow sounds right.  It
looks like it just needs a small fix in Dolphin.  I only found it because I
happened to be working (too) late. ;)

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Time<<fromString:

Andy Bower
Christopher,

This has been recorded as defect #236 and a fix will follow in the next
patch level.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com

---
Visit the Dolphin Smalltalk WikiWeb
http://www.object-arts.com/wiki/html/Dolphin/FrontPage.htm
---

"Christopher J. Demers" <[hidden email]> wrote in
message news:9eemtv$2gbtl$[hidden email]...
> Paul Kelly <[hidden email]> wrote in message
> news:9eecni$a4f$[hidden email]...
> > on a flyer ....  But there is a space between "12:00" and the "AM" but
not
> > for the "00:00AM"
> >
> > Could this be it?
>
> No, the spaces do not matter.  Don's explanation bellow sounds right.  It
> looks like it just needs a small fix in Dolphin.  I only found it because
I
> happened to be working (too) late. ;)
>
> Chris
>
>