[squeak-dev] The Inbox: Chronology-Core-cbc.45.mcz

Chris Cunningham cunningham.cb at gmail.com
Tue May 14 22:38:28 UTC 2019


Apparently I use this, but not where I run into it every day.

And there are test to make sure #asLocal works - but they involve having
aDateAndTime set, then comparing aDateAndTime asLocal = aDateAndTime, which
obviously works.  Since the previous code actually changed aDateAndTime,
the two are identical (as opposed to just equivalent).

If no one objects, I'll move this into trunk in a couple of days.

-cbc

On Tue, May 14, 2019 at 3:33 PM <commits at source.squeak.org> wrote:

> Chris Cunningham uploaded a new version of Chronology-Core to project The
> Inbox:
> http://source.squeak.org/inbox/Chronology-Core-cbc.45.mcz
>
> ==================== Summary ====================
>
> Name: Chronology-Core-cbc.45
> Author: cbc
> Time: 14 May 2019, 3:33:13.333275 pm
> UUID: 4117cd16-a46a-4647-9630-49ee93d3f725
> Ancestors: Chronology-Core-nice.44
>
> With the UTC / DateAndTime changs, DateAndTime>>utcOffset: changed to
> update the existing instance in place instead of creating a new instance.
> The change fixes #asLocal to create a new instance, bypassing #utcOffset:.
> Follows the same logic as used in #asUTC
>
> =============== Diff against Chronology-Core-nice.44 ===============
>
> Item was changed:
>   ----- Method: DateAndTime>>asLocal (in category 'ansi protocol') -----
>   asLocal
> +       "Anwer a copy of oursielves (if necessary) in the local timezone.
> #utcOffset: now modifies my instance, so the creation of the new instance
> should happen here."
> -
>
>         ^ (self offset = self class localOffset)
> -
>                 ifTrue: [self]
> +               ifFalse: [self copy localOffsetSeconds: self class
> localOffset asSeconds]!
> -               ifFalse: [self utcOffset: self class localOffset]!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190514/b68d85cd/attachment.html>


More information about the Squeak-dev mailing list