One Logo Pool Ball
Foundation · IOS API REFERENCE

DateComponentsFormatter

class · iOS 8.0+ · SDK 27.1

class DateComponentsFormatter

Members (29)

static · iOS 8.0+

localizedString

TypeScript
static localizedString(components: DateComponents, unitsStyle: DateComponentsFormatter_UnitsStyle): (string) | null
Swift declaration
class func localizedString(from components: DateComponents, unitsStyle: DateComponentsFormatter.UnitsStyle) -> String?
method · iOS 8.0+

getObjectValue

TypeScript
getObjectValue(string: string): { $ret: boolean; $out: { "obj": (unknown) | null; "error": (NSString) | null } }
Swift declaration
func getObjectValue(_ obj: AutoreleasingUnsafeMutablePointer<AnyObject?>?, for string: String, errorDescription error: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool

Omit the output parameters from the call. The result contains $ret and $out, with obj, error inside $out.

init

init

TypeScript
static init(): DateComponentsFormatter
Swift declaration
init()
method · iOS 8.0+

string

TypeScript
stringFor(obj?: (unknown) | null): (string) | null
Swift declaration
func string(for obj: Any?) -> String?
method · iOS 8.0+

string

TypeScript
stringFromTo(startDate: globalThis.Date, endDate: globalThis.Date): (string) | null
Swift declaration
func string(from startDate: Date, to endDate: Date) -> String?
method · iOS 8.0+

string

TypeScript
stringFrom(components: DateComponents): (string) | null
Swift declaration
func string(from components: DateComponents) -> String?
method · iOS 8.0+

string

TypeScript
stringFrom65180(ti: number): (string) | null
Swift declaration
func string(from ti: TimeInterval) -> String?
get · iOS 8.0+

allowedUnits

TypeScript
get allowedUnits(): NSCalendar_Unit
Swift declaration
var allowedUnits: NSCalendar.Unit { get set }
set · iOS 8.0+

allowedUnits

TypeScript
set allowedUnits(value: NSCalendar_Unit)
Swift declaration
var allowedUnits: NSCalendar.Unit { get set }
get · iOS 8.0+

allowsFractionalUnits

TypeScript
get allowsFractionalUnits(): boolean
Swift declaration
var allowsFractionalUnits: Bool { get set }
set · iOS 8.0+

allowsFractionalUnits

TypeScript
set allowsFractionalUnits(value: boolean)
Swift declaration
var allowsFractionalUnits: Bool { get set }
get · iOS 8.0+

calendar

TypeScript
get calendar(): (Calendar) | null
Swift declaration
var calendar: Calendar? { get set }
set · iOS 8.0+

calendar

TypeScript
set calendar(value: (Calendar) | null)
Swift declaration
var calendar: Calendar? { get set }
get · iOS 8.0+

collapsesLargestUnit

TypeScript
get collapsesLargestUnit(): boolean
Swift declaration
var collapsesLargestUnit: Bool { get set }
set · iOS 8.0+

collapsesLargestUnit

TypeScript
set collapsesLargestUnit(value: boolean)
Swift declaration
var collapsesLargestUnit: Bool { get set }
get · iOS 8.0+

formattingContext

TypeScript
get formattingContext(): Formatter_Context
Swift declaration
var formattingContext: Formatter.Context { get set }
set · iOS 8.0+

formattingContext

TypeScript
set formattingContext(value: Formatter_Context)
Swift declaration
var formattingContext: Formatter.Context { get set }
get · iOS 8.0+

includesApproximationPhrase

TypeScript
get includesApproximationPhrase(): boolean
Swift declaration
var includesApproximationPhrase: Bool { get set }
set · iOS 8.0+

includesApproximationPhrase

TypeScript
set includesApproximationPhrase(value: boolean)
Swift declaration
var includesApproximationPhrase: Bool { get set }
get · iOS 8.0+

includesTimeRemainingPhrase

TypeScript
get includesTimeRemainingPhrase(): boolean
Swift declaration
var includesTimeRemainingPhrase: Bool { get set }
set · iOS 8.0+

includesTimeRemainingPhrase

TypeScript
set includesTimeRemainingPhrase(value: boolean)
Swift declaration
var includesTimeRemainingPhrase: Bool { get set }
get · iOS 8.0+

maximumUnitCount

TypeScript
get maximumUnitCount(): number
Swift declaration
var maximumUnitCount: Int { get set }
set · iOS 8.0+

maximumUnitCount

TypeScript
set maximumUnitCount(value: number)
Swift declaration
var maximumUnitCount: Int { get set }
get · iOS 11.0+

referenceDate

TypeScript
get referenceDate(): (globalThis.Date) | null
Swift declaration
var referenceDate: Date? { get set }
set · iOS 11.0+

referenceDate

TypeScript
set referenceDate(value: (globalThis.Date) | null)
Swift declaration
var referenceDate: Date? { get set }
get · iOS 8.0+

unitsStyle

TypeScript
get unitsStyle(): DateComponentsFormatter_UnitsStyle
Swift declaration
var unitsStyle: DateComponentsFormatter.UnitsStyle { get set }
set · iOS 8.0+

unitsStyle

TypeScript
set unitsStyle(value: DateComponentsFormatter_UnitsStyle)
Swift declaration
var unitsStyle: DateComponentsFormatter.UnitsStyle { get set }
get · iOS 8.0+

zeroFormattingBehavior

TypeScript
get zeroFormattingBehavior(): DateComponentsFormatter_ZeroFormattingBehavior
Swift declaration
var zeroFormattingBehavior: DateComponentsFormatter.ZeroFormattingBehavior { get set }
set · iOS 8.0+

zeroFormattingBehavior

TypeScript
set zeroFormattingBehavior(value: DateComponentsFormatter_ZeroFormattingBehavior)
Swift declaration
var zeroFormattingBehavior: DateComponentsFormatter.ZeroFormattingBehavior { get set }

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →