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
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"]