Hi Marcel,


"TimeZone timeZoensWithOffset:" reads redundant to me ... We also don't have "Number numberFromString:" autc. for the same reason ... But regarding all/select/whatever, I have no opinion on that wording at all. :-)


Best,

Christoph


Von: Marcel Taeumel via Squeak-dev <squeak-dev@lists.squeakfoundation.org>
Gesendet: Montag, 22. Mai 2023 15:54:31
An: Rein, Patrick via Squeak-dev
Cc: Taeumel, Marcel
Betreff: [squeak-dev] Re: Review Request: allTimeZones.4.cs
 
Hi Christoph --

#allForOffset: -> #timeZonesWithOffset: ?

...maybe this is something for an English-native speaker =) We don't use 'all' for a #select: query, right? Still, 'all' should indicate that DST is included... hmm... is this correct for the "time domain"?

Best,
Marcel

Am 18.05.2023 22:12:03 schrieb christoph.thiede@student.hpi.uni-potsdam.de <christoph.thiede@student.hpi.uni-potsdam.de>:

=============== Summary ===============

Change Set:        allTimeZones
Date:            18 May 2023
Author:            Christoph Thiede

Adds convenient accessors to TimeZone class side for browsing and finding timezones. Also adds tests.

=============== Diff ===============

TimeZone class>>allForOffset: {accessing} · ct 5/15/2023 19:23
+ allForOffset: aDuration
+
+     ^ self allTimeZones select: [:ea | ea offset = aDuration]


TimeZone class>>allTimeZones {accessing} · ct 5/14/2023 21:19
+ allTimeZones
+
+     ^ self timeZones , self timeZonesDST


TimeZoneTest
+ ClassTestCase subclass: #TimeZoneTest
+     instanceVariableNames: ''
+     classVariableNames: ''
+     poolDictionaries: ''
+     category: 'Chronology-Tests'
+
+ TimeZoneTest class
+     instanceVariableNames: ''
+
+ ""


TimeZoneTest>>testAllForOffset {tests} · ct 5/17/2023 20:29
+ testAllForOffset
+
+     self assert: ((self classToBeTested allForOffset: 0 hours) collect: #abbreviation) = #('UTC' 'GMT').
+     self assert: (self classToBeTested allForOffset: -14 hours) isEmpty.


TimeZoneTest>>testAllTimeZones {tests} · ct 5/17/2023 20:26
+ testAllTimeZones
+
+     self assert: self classToBeTested allTimeZones notEmpty.
+     self assert: (self classToBeTested allTimeZones anySatisfy: [:ea | ea offset = 2 hours]).


---
Sent from Squeak Inbox Talk
["allTimeZones.4.cs"]