Skip to content

Commit

Permalink
consistent verb tense
Browse files Browse the repository at this point in the history
  • Loading branch information
davedelong committed Feb 18, 2024
1 parent d706ede commit 84cdef6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Sources/Time/1-Core Types/Instant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public struct Instant: Hashable, Comparable, InstantProtocol, Sendable {
///
/// The resulting `Instant` still refers to the *same* point in time as the original `Instant`.
/// This method is used to retrieve an alternate *representation* of that instant.
public func converting(to epoch: Epoch) -> Instant {
public func converted(to epoch: Epoch) -> Instant {
if epoch == self.epoch { return self }
let epochOffset = epoch.offsetFromReferenceDate - self.epoch.offsetFromReferenceDate
let epochInterval = intervalSinceEpoch - epochOffset
Expand Down
14 changes: 7 additions & 7 deletions Sources/Time/3-RegionalClock/RegionalClock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,37 +103,37 @@ extension RegionalClock {
///
/// - Parameter timeZone: The `TimeZone` of the new `RegionalClock`.
/// - Returns: A new `RegionalClock` that reports values in the specified `TimeZone`.
public func converting(to timeZone: TimeZone) -> any RegionalClock {
public func converted(to timeZone: TimeZone) -> any RegionalClock {
if timeZone.isEquivalent(to: self.timeZone) { return self }
let newRegion = self.region.setTimeZone(timeZone)
return self.converting(to: newRegion)
return self.converted(to: newRegion)
}

/// Convert a clock to a new calendar.
///
/// - Parameter calendar: The `Calendar` of the new `RegionalClock`.
/// - Returns: A new `RegionalClock` that reports values in the specified `Calendar`.
public func converting(to calendar: Calendar) -> any RegionalClock {
public func converted(to calendar: Calendar) -> any RegionalClock {
if calendar.isEquivalent(to: self.calendar) { return self }
let newRegion = self.region.setCalendar(calendar)
return self.converting(to: newRegion)
return self.converted(to: newRegion)
}

/// Convert a clock to a new locale.
///
/// - Parameter locale: The `Locale` of the new `RegionalClock`.
/// - Returns: A new `RegionalClock` that reports values in the specified `Locale`.
public func converting(to locale: Locale) -> any RegionalClock {
public func converted(to locale: Locale) -> any RegionalClock {
if locale.isEquivalent(to: self.locale) { return self }
let newRegion = self.region.setLocale(locale)
return self.converting(to: newRegion)
return self.converted(to: newRegion)
}

/// Convert a clock to a new region.
///
/// - Parameter region: The `Region` of the new `RegionalClock`.
/// - Returns: A new `RegionalClock` that reports values in the specified `Region`.
public func converting(to newRegion: Region) -> any RegionalClock {
public func converted(to newRegion: Region) -> any RegionalClock {
if newRegion.isEquivalent(to: self.region) { return self }
return CustomRegionClock(base: self, region: newRegion)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Time/Internals/Fixed+Internal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension Fixed {
internal var approximateMidPoint: Instant {
let r = self.range
let lower = r.lowerBound
let upper = r.upperBound.converting(to: lower.epoch)
let upper = r.upperBound.converted(to: lower.epoch)
let duration = upper.intervalSinceEpoch - lower.intervalSinceEpoch
let midPoint = lower + (duration / 2.0)
return max(lower, midPoint)
Expand Down

0 comments on commit 84cdef6

Please sign in to comment.