Calendar
public extension Calendar
-
A cached gregorian calendar.
The calendar’s locale and timeZone are set to
testableCurrentto prevent flaky tests.Declaration
Swift
static let gregorian: Calendar -
Returns the
currentcalendar, except in test mode wheregregorianis returned instead to prevent flaky tests.Relies on
ProcessInfo.isRunningInTestModeto determine if the code is running in test mode or not.Declaration
Swift
static var testableCurrent: Calendar { get } -
A cached iso8601 calendar.
The calendar’s locale and timeZone are set to
testableCurrentto prevent flaky tests.Declaration
Swift
static let iso8601: Calendar
View on GitHub