<div dir="ltr">Hi Chris,<div><br><div>I though of that.  The number of methods that derive off of dayOfWeek is significant in Week; I'm not sure where outside of Week it is used as well.</div></div><div><br></div><div>Methods to change</div><div>Week class</div><div>  #indexOfDay:</div><div>  #nameOfDay:</div><div>  #starting:duration:</div><div>Week instance</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 28, 2019 at 4:02 PM Chris Muller <<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What about keeping the existing selector #dayOfWeek, and making it<br>
respect Week>>startDay?<br>
<br>
<br>
On Sun, Apr 28, 2019 at 8:35 AM David T. Lewis <<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>> wrote:<br>
><br>
> The addition of #dayOfLocalWeek is a good addition. But I want ask<br>
> about the selector name and category. This isn't a criticism, more of<br>
> a question because I do not understand how is it used in practice.<br>
><br>
> We have #toggleStartMonday that changes start day to either #Monday or<br>
> #Sunday. This is an original brp method, but I don't know the reason<br>
> for it. And #dayOfWeek is listed in the 'ansi-protocol'. Is the start<br>
> day of week actually specified in the ANSI standard?<br>
><br>
> While I cannot think of any better selector name, I tend to think of<br>
> "local" as refering to local time offset from UTC, so dayOfLocalWeek<br>
> seems misleading in that sense. To me it seems more like dayOfLocalWeek<br>
> is a dayOfWeek that is corrected for the toggled startDay. So maybe<br>
> a name like correctedDayOfWeek or dayOfWeekCorrected might work? But<br>
> these do not seem satisfactory either, because they do not suggest<br>
> what is being corrected.<br>
><br>
> Suggestions welcome, and if nobody can think of a better idea then I<br>
> am +1 for moving this to trunk as it is.<br>
><br>
> Dave<br>
><br>
><br>
> On Mon, Apr 22, 2019 at 04:00:19PM +0000, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:<br>
> > Chris Cunningham uploaded a new version of Chronology-Core to project The Inbox:<br>
> > <a href="http://source.squeak.org/inbox/Chronology-Core-cbc.41.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Chronology-Core-cbc.41.mcz</a><br>
> ><br>
> > ==================== Summary ====================<br>
> ><br>
> > Name: Chronology-Core-cbc.41<br>
> > Author: cbc<br>
> > Time: 22 April 2019, 8:58:13.835953 am<br>
> > UUID: 3d8013b6-d58f-004e-8e6b-5a59ed5841e7<br>
> > Ancestors: Chronology-Core-dtl.40<br>
> ><br>
> > We have the ability to change the starting day of the week (Week>>startDay:).<br>
> > This change adds #dayOfLocalWeek to DateAndTime and Timespan to return the indexed day of the week based on the altered starting day.<br>
> > Original #dayOfWeek is left as-is along with all other working code.<br>
> ><br>
> > =============== Diff against Chronology-Core-dtl.40 ===============<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: DateAndTime>>dayOfLocalWeek (in category 'ansi protocol') -----<br>
> > + dayOfLocalWeek<br>
> > +<br>
> > +     "Sunday=1, ... , Saturday=7"<br>
> > +<br>
> > +     ^ (self julianDayNumber + 2 - Week weekdayStartIndex rem: 7) + 1<br>
> > + !<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: Timespan>>dayOfLocalWeek (in category 'ansi protocol') -----<br>
> > + dayOfLocalWeek<br>
> > +     "Answer the day of the week represented by the receiver."<br>
> > +<br>
> > +     ^ start dayOfLocalWeek!<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: Week class>>weekdayStartIndex (in category 'squeak protocol') -----<br>
> > + weekdayStartIndex<br>
> > +     ^self indexOfDay: self startDay!<br>
> ><br>
> ><br>
><br>
<br>
</blockquote></div>