Chris Muller uploaded a new version of Chronology-Core to project The Inbox:
http://source.squeak.org/inbox/Chronology-Core-cmm.45.mcz ==================== Summary ==================== Name: Chronology-Core-cmm.45 Author: cmm Time: 14 May 2019, 10:33:41.936949 pm UUID: 6355a6a7-febb-4ac8-a024-bf13bd00b8dc Ancestors: Chronology-Core-nice.44 - Make #utcOffset: match the prior behavior. - Move Duration convenience constructors in Number to this package. =============== Diff against Chronology-Core-nice.44 =============== Item was changed: ----- Method: DateAndTime>>utcOffset: (in category 'squeak protocol') ----- + utcOffset: anOffset + "Answer a DateAndTime equivalent to the receiver but offset from UTC by anOffset" + ^ self class + utcMicroseconds: utcMicroseconds + offset: anOffset asDuration asSeconds! - utcOffset: anOffset - - "Answer a <DateAndTime> equivalent to the receiver but offset from UTC by anOffset" - - self flag: #FIXME. "check the definition of this and of #offset:" - ^self utcMicroseconds: utcMicroseconds offset: anOffset asDuration asSeconds - ! Item was added: + ----- Method: Number>>microSecond (in category '*chronology-core') ----- + microSecond + ^ self sign microSeconds! Item was added: + ----- Method: Number>>microSeconds (in category '*chronology-core') ----- + microSeconds + ^ Duration nanoSeconds: self * 1000! Item was added: + ----- Method: Number>>milliSecond (in category '*chronology-core') ----- + milliSecond + + ^ self sign milliSeconds + ! Item was added: + ----- Method: Number>>milliSeconds (in category '*chronology-core') ----- + milliSeconds + + ^ Duration milliSeconds: self + ! Item was added: + ----- Method: Number>>nanoSecond (in category '*chronology-core') ----- + nanoSecond + + ^ self sign nanoSeconds + ! Item was added: + ----- Method: Number>>nanoSeconds (in category '*chronology-core') ----- + nanoSeconds + + ^ Duration nanoSeconds: self.! Item was added: + ----- Method: Number>>second (in category '*chronology-core') ----- + second + + ^ self sign seconds + ! Item was added: + ----- Method: Number>>seconds (in category '*chronology-core') ----- + seconds + + ^ Duration seconds: self! |
Dave had a #FIXME marker in #utcOffset:, it's the one that was deviant
from the prior behavior. #asLocal is good. Also included fix to move Duration creating convenience methods to this package with a pair of microSeconds accessors included. (woops, I just saw I forgot to truncate). On Tue, May 14, 2019 at 10:33 PM <[hidden email]> wrote: > > Chris Muller uploaded a new version of Chronology-Core to project The Inbox: > http://source.squeak.org/inbox/Chronology-Core-cmm.45.mcz > > ==================== Summary ==================== > > Name: Chronology-Core-cmm.45 > Author: cmm > Time: 14 May 2019, 10:33:41.936949 pm > UUID: 6355a6a7-febb-4ac8-a024-bf13bd00b8dc > Ancestors: Chronology-Core-nice.44 > > - Make #utcOffset: match the prior behavior. > - Move Duration convenience constructors in Number to this package. > > =============== Diff against Chronology-Core-nice.44 =============== > > Item was changed: > ----- Method: DateAndTime>>utcOffset: (in category 'squeak protocol') ----- > + utcOffset: anOffset > + "Answer a DateAndTime equivalent to the receiver but offset from UTC by anOffset" > + ^ self class > + utcMicroseconds: utcMicroseconds > + offset: anOffset asDuration asSeconds! > - utcOffset: anOffset > - > - "Answer a <DateAndTime> equivalent to the receiver but offset from UTC by anOffset" > - > - self flag: #FIXME. "check the definition of this and of #offset:" > - ^self utcMicroseconds: utcMicroseconds offset: anOffset asDuration asSeconds > - ! > > Item was added: > + ----- Method: Number>>microSecond (in category '*chronology-core') ----- > + microSecond > + ^ self sign microSeconds! > > Item was added: > + ----- Method: Number>>microSeconds (in category '*chronology-core') ----- > + microSeconds > + ^ Duration nanoSeconds: self * 1000! > > Item was added: > + ----- Method: Number>>milliSecond (in category '*chronology-core') ----- > + milliSecond > + > + ^ self sign milliSeconds > + ! > > Item was added: > + ----- Method: Number>>milliSeconds (in category '*chronology-core') ----- > + milliSeconds > + > + ^ Duration milliSeconds: self > + ! > > Item was added: > + ----- Method: Number>>nanoSecond (in category '*chronology-core') ----- > + nanoSecond > + > + ^ self sign nanoSeconds > + ! > > Item was added: > + ----- Method: Number>>nanoSeconds (in category '*chronology-core') ----- > + nanoSeconds > + > + ^ Duration nanoSeconds: self.! > > Item was added: > + ----- Method: Number>>second (in category '*chronology-core') ----- > + second > + > + ^ self sign seconds > + ! > > Item was added: > + ----- Method: Number>>seconds (in category '*chronology-core') ----- > + seconds > + > + ^ Duration seconds: self! > > |
This is a better fix than mine. Passes tests. My code works with this (and without my other change - i.e., reverted my alterations). +1 On Tue, May 14, 2019 at 8:43 PM Chris Muller <[hidden email]> wrote: Dave had a #FIXME marker in #utcOffset:, it's the one that was deviant |
+1
Dave On Wed, May 15, 2019 at 08:31:28AM -0700, Chris Cunningham wrote: > This is a better fix than mine. > Passes tests. > My code works with this (and without my other change - i.e., reverted my > alterations). > > +1 > > On Tue, May 14, 2019 at 8:43 PM Chris Muller <[hidden email]> wrote: > > > Dave had a #FIXME marker in #utcOffset:, it's the one that was deviant > > from the prior behavior. #asLocal is good. > > > > Also included fix to move Duration creating convenience methods to > > this package with a pair of microSeconds accessors included. (woops, > > I just saw I forgot to truncate). > > > > > > > > On Tue, May 14, 2019 at 10:33 PM <[hidden email]> wrote: > > > > > > Chris Muller uploaded a new version of Chronology-Core to project The > > Inbox: > > > http://source.squeak.org/inbox/Chronology-Core-cmm.45.mcz > > > > > > ==================== Summary ==================== > > > > > > Name: Chronology-Core-cmm.45 > > > Author: cmm > > > Time: 14 May 2019, 10:33:41.936949 pm > > > UUID: 6355a6a7-febb-4ac8-a024-bf13bd00b8dc > > > Ancestors: Chronology-Core-nice.44 > > > > > > - Make #utcOffset: match the prior behavior. > > > - Move Duration convenience constructors in Number to this package. > > > > > > =============== Diff against Chronology-Core-nice.44 =============== > > > > > > Item was changed: > > > ----- Method: DateAndTime>>utcOffset: (in category 'squeak protocol') > > ----- > > > + utcOffset: anOffset > > > + "Answer a DateAndTime equivalent to the receiver but offset from > > UTC by anOffset" > > > + ^ self class > > > + utcMicroseconds: utcMicroseconds > > > + offset: anOffset asDuration asSeconds! > > > - utcOffset: anOffset > > > - > > > - "Answer a <DateAndTime> equivalent to the receiver but offset > > from UTC by anOffset" > > > - > > > - self flag: #FIXME. "check the definition of this and of #offset:" > > > - ^self utcMicroseconds: utcMicroseconds offset: anOffset > > asDuration asSeconds > > > - ! > > > > > > Item was added: > > > + ----- Method: Number>>microSecond (in category '*chronology-core') > > ----- > > > + microSecond > > > + ^ self sign microSeconds! > > > > > > Item was added: > > > + ----- Method: Number>>microSeconds (in category '*chronology-core') > > ----- > > > + microSeconds > > > + ^ Duration nanoSeconds: self * 1000! > > > > > > Item was added: > > > + ----- Method: Number>>milliSecond (in category '*chronology-core') > > ----- > > > + milliSecond > > > + > > > + ^ self sign milliSeconds > > > + ! > > > > > > Item was added: > > > + ----- Method: Number>>milliSeconds (in category '*chronology-core') > > ----- > > > + milliSeconds > > > + > > > + ^ Duration milliSeconds: self > > > + ! > > > > > > Item was added: > > > + ----- Method: Number>>nanoSecond (in category '*chronology-core') ----- > > > + nanoSecond > > > + > > > + ^ self sign nanoSeconds > > > + ! > > > > > > Item was added: > > > + ----- Method: Number>>nanoSeconds (in category '*chronology-core') > > ----- > > > + nanoSeconds > > > + > > > + ^ Duration nanoSeconds: self.! > > > > > > Item was added: > > > + ----- Method: Number>>second (in category '*chronology-core') ----- > > > + second > > > + > > > + ^ self sign seconds > > > + ! > > > > > > Item was added: > > > + ----- Method: Number>>seconds (in category '*chronology-core') ----- > > > + seconds > > > + > > > + ^ Duration seconds: self! > > > > > > > > > > > |
In reply to this post by cbc
But it's not ready yet. Number>>#microSeconds is wrong. I'd like it
to be consistent with #nanoSeconds and #milliSeconds in the way it truncates... Would you like to take a crack at that? Otherwise, please give me a day or two. Thanks, Chris On Wed, May 15, 2019 at 10:31 AM Chris Cunningham <[hidden email]> wrote: > > This is a better fix than mine. > Passes tests. > My code works with this (and without my other change - i.e., reverted my alterations). > > +1 > > On Tue, May 14, 2019 at 8:43 PM Chris Muller <[hidden email]> wrote: >> >> Dave had a #FIXME marker in #utcOffset:, it's the one that was deviant >> from the prior behavior. #asLocal is good. >> >> Also included fix to move Duration creating convenience methods to >> this package with a pair of microSeconds accessors included. (woops, >> I just saw I forgot to truncate). >> >> >> >> On Tue, May 14, 2019 at 10:33 PM <[hidden email]> wrote: >> > >> > Chris Muller uploaded a new version of Chronology-Core to project The Inbox: >> > http://source.squeak.org/inbox/Chronology-Core-cmm.45.mcz >> > >> > ==================== Summary ==================== >> > >> > Name: Chronology-Core-cmm.45 >> > Author: cmm >> > Time: 14 May 2019, 10:33:41.936949 pm >> > UUID: 6355a6a7-febb-4ac8-a024-bf13bd00b8dc >> > Ancestors: Chronology-Core-nice.44 >> > >> > - Make #utcOffset: match the prior behavior. >> > - Move Duration convenience constructors in Number to this package. >> > >> > =============== Diff against Chronology-Core-nice.44 =============== >> > >> > Item was changed: >> > ----- Method: DateAndTime>>utcOffset: (in category 'squeak protocol') ----- >> > + utcOffset: anOffset >> > + "Answer a DateAndTime equivalent to the receiver but offset from UTC by anOffset" >> > + ^ self class >> > + utcMicroseconds: utcMicroseconds >> > + offset: anOffset asDuration asSeconds! >> > - utcOffset: anOffset >> > - >> > - "Answer a <DateAndTime> equivalent to the receiver but offset from UTC by anOffset" >> > - >> > - self flag: #FIXME. "check the definition of this and of #offset:" >> > - ^self utcMicroseconds: utcMicroseconds offset: anOffset asDuration asSeconds >> > - ! >> > >> > Item was added: >> > + ----- Method: Number>>microSecond (in category '*chronology-core') ----- >> > + microSecond >> > + ^ self sign microSeconds! >> > >> > Item was added: >> > + ----- Method: Number>>microSeconds (in category '*chronology-core') ----- >> > + microSeconds >> > + ^ Duration nanoSeconds: self * 1000! >> > >> > Item was added: >> > + ----- Method: Number>>milliSecond (in category '*chronology-core') ----- >> > + milliSecond >> > + >> > + ^ self sign milliSeconds >> > + ! >> > >> > Item was added: >> > + ----- Method: Number>>milliSeconds (in category '*chronology-core') ----- >> > + milliSeconds >> > + >> > + ^ Duration milliSeconds: self >> > + ! >> > >> > Item was added: >> > + ----- Method: Number>>nanoSecond (in category '*chronology-core') ----- >> > + nanoSecond >> > + >> > + ^ self sign nanoSeconds >> > + ! >> > >> > Item was added: >> > + ----- Method: Number>>nanoSeconds (in category '*chronology-core') ----- >> > + nanoSeconds >> > + >> > + ^ Duration nanoSeconds: self.! >> > >> > Item was added: >> > + ----- Method: Number>>second (in category '*chronology-core') ----- >> > + second >> > + >> > + ^ self sign seconds >> > + ! >> > >> > Item was added: >> > + ----- Method: Number>>seconds (in category '*chronology-core') ----- >> > + seconds >> > + >> > + ^ Duration seconds: self! >> > >> > >> > |
Hi Chris, I would just create a Duration class>>microSeconds: and delegate There is also minutes hours days weeks which require repackaging Le mer. 15 mai 2019 à 21:14, Chris Muller <[hidden email]> a écrit : But it's not ready yet. Number>>#microSeconds is wrong. I'd like it |
Free forum by Nabble | Edit this page |