IntervalFormatStyle
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
struct IntervalFormatStyle
struct IntervalFormatStyle
s20FoundationEssentials4DateV0A20InternationalizationE19IntervalFormatStyleV
What are these?5PD21
import FoundationInternationalization
import FoundationEssentials
struct Date
Date
represents a single point in time.
func formatted() -> String
func formatted(date: Date.FormatStyle.DateStyle, time: Date.FormatStyle.TimeStyle) -> String
Converts self
to its textual representation that contains both the date and time parts. The exact format depends on the user’s preferences.
struct AnchoredRelativeFormatStyle
A relative format style that is detached from the system time, and instead formats an anchor date relative to the format input.
struct AttributedStyle
struct ComponentsFormatStyle
struct FormatString
struct FormatStyle
Strategies for formatting a Date
.
struct ParseStrategy
Options for parsing string representations of dates to create a Date
instance.
struct RelativeFormatStyle
struct VerbatimFormatStyle
Formats a Date
using the given format.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol FormatStyle : Decodable, Encodable, Hashable
A type that can convert a given data type into a representation.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
init(date: Date.IntervalFormatStyle.DateStyle? = nil, time: Date.IntervalFormatStyle.TimeStyle? = nil, locale: Locale = .autoupdatingCurrent, calendar: Calendar = .autoupdatingCurrent, timeZone: TimeZone = .autoupdatingCurrent)
Creates a new FormatStyle
with the given configurations.
init(from decoder: any Decoder) throws
var calendar: Calendar
var locale: Locale
var timeZone: TimeZone
func day() -> Date.IntervalFormatStyle
func format(_ v: Range<Date>) -> String
func hour(_ format: Date.IntervalFormatStyle.Symbol.Hour = .defaultDigits(amPM: .abbreviated)) -> Date.IntervalFormatStyle
func locale(_ locale: Locale) -> Date.IntervalFormatStyle
func minute() -> Date.IntervalFormatStyle
func month(_ format: Date.IntervalFormatStyle.Symbol.Month = .abbreviated) -> Date.IntervalFormatStyle
func second() -> Date.IntervalFormatStyle
func timeZone(_ format: Date.IntervalFormatStyle.Symbol.TimeZone = .genericName(.short)) -> Date.IntervalFormatStyle
func weekday(_ format: Date.IntervalFormatStyle.Symbol.Weekday = .abbreviated) -> Date.IntervalFormatStyle
func year() -> Date.IntervalFormatStyle
typealias DateStyle = Date.FormatStyle.DateStyle
typealias Symbol = Date.FormatStyle.Symbol
typealias TimeStyle = Date.FormatStyle.TimeStyle
static var interval: Date.IntervalFormatStyle { get }
static func currency<Value>(code: String) -> Self where Self == FloatingPointFormatStyle<Value>.Currency, Value : BinaryFloatingPoint
static func currency<V>(code: String) -> Self where Self == IntegerFormatStyle<V>.Currency, V : BinaryInteger
static func list<MemberStyle, Base>(memberStyle: MemberStyle, type: ListFormatStyle<MemberStyle, Base>.ListType, width: ListFormatStyle<MemberStyle, Base>.Width = .standard) -> Self where Self == ListFormatStyle<MemberStyle, Base>, MemberStyle : FormatStyle, Base : Sequence, MemberStyle.FormatInput == Base.Element, MemberStyle.FormatOutput == String
static func list<Base>(type: ListFormatStyle<StringStyle, Base>.ListType, width: ListFormatStyle<StringStyle, Base>.Width = .standard) -> Self where Self == ListFormatStyle<StringStyle, Base>, Base : Sequence, Base.Element == String
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.