Closed imthath-m closed 1 year ago
I think this convenience initializer could hide necessary information that could lead to a developer introducing undesired behavior into their app. I don't think a default calculation method makes sense, each calculation method is valid for a specific area and by setting a default it might make a developer assume its validity in situations where it shouldn't be used.
I also think it's helpful that our initializer requires DateComponents. This signals to the developer that they are responsible for choosing a calendar with the correct timezone set that will give the expected DateComponents. By using the currentCalendar you are assuming the target's timezone is the same as the system, which may not be correct.
Add convenience intializer using
Date
andCalculationMethod
types with default values