FormattedTimeIntervalLabelGenerator
public struct FormattedTimeIntervalLabelGenerator : TimeLabelGenerator
Formats interval time labels using an optional date formatter object.
-
Undocumented
Declaration
Swift
public init(_ formatter: DateFormatter? = nil, separator: String? = nil)
-
Undocumented
Declaration
Swift
public var formatter: DateFormatter?
-
Optional separator between start and finish parts of the label. If not specified, a dash is used as separator.
Declaration
Swift
public var separator: String?
-
Returns strings computed using the specified formatter object, passing the start and finish times of each interval as input and combining the results, joining them using the specified separator. Note that the finish time is internally decremented by a millisecond internally (before passing it to the formatter) to obtain values that better represent the labeled interval.
Declaration
Swift
public func label(for time: TimeRange) -> String?