One Logo Pool Ball
Foundation · IOS API REFERENCE

NSCalendar

class · SDK 27.1

class NSCalendar

Members (68)

init · iOS 8.0+

init

TypeScript
static initIdentifier(calendarIdentifierConstant: NSCalendar_Identifier): (NSCalendar) | null
Swift declaration
init?(identifier calendarIdentifierConstant: NSCalendar.Identifier)
get · iOS 2.0+

autoupdatingCurrent

TypeScript
static get autoupdatingCurrent(): Calendar
Swift declaration
class var autoupdatingCurrent: Calendar { get }
get

current

TypeScript
static get current(): Calendar
Swift declaration
class var current: Calendar { get }
method · iOS 8.0+

compare

TypeScript
compare(date1: globalThis.Date, date2: globalThis.Date, unit: NSCalendar_Unit): ComparisonResult
Swift declaration
func compare(_ date1: Date, to date2: Date, toUnitGranularity unit: NSCalendar.Unit) -> ComparisonResult
method · iOS 8.0+

component

TypeScript
component(unit: NSCalendar_Unit, date: globalThis.Date): number
Swift declaration
func component(_ unit: NSCalendar.Unit, from date: Date) -> Int
method

components

TypeScript
componentsFrom(unitFlags: NSCalendar_Unit, date: globalThis.Date): DateComponents
Swift declaration
func components(_ unitFlags: NSCalendar.Unit, from date: Date) -> DateComponents
method

components

TypeScript
componentsFromToOptions(unitFlags: NSCalendar_Unit, startingDate: globalThis.Date, resultDate: globalThis.Date, opts?: NSCalendar_Options): DateComponents
Swift declaration
func components(_ unitFlags: NSCalendar.Unit, from startingDate: Date, to resultDate: Date, options opts: NSCalendar.Options = []) -> DateComponents
method · iOS 8.0+

components

TypeScript
componentsFromToOptions12596(unitFlags: NSCalendar_Unit, startingDateComp: DateComponents, resultDateComp: DateComponents, options?: NSCalendar_Options): DateComponents
Swift declaration
func components(_ unitFlags: NSCalendar.Unit, from startingDateComp: DateComponents, to resultDateComp: DateComponents, options: NSCalendar.Options = []) -> DateComponents
method · iOS 8.0+

components

TypeScript
componentsInFrom(timezone: TimeZone, date: globalThis.Date): DateComponents
Swift declaration
func components(in timezone: TimeZone, from date: Date) -> DateComponents
method · iOS 8.0+

date

TypeScript
dateMatchesComponents(date: globalThis.Date, components: DateComponents): boolean
Swift declaration
func date(_ date: Date, matchesComponents components: DateComponents) -> Bool
method

date

TypeScript
dateByAddingToOptions(comps: DateComponents, date: globalThis.Date, opts?: NSCalendar_Options): (globalThis.Date) | null
Swift declaration
func date(byAdding comps: DateComponents, to date: Date, options opts: NSCalendar.Options = []) -> Date?
method · iOS 8.0+

date

TypeScript
dateByAddingValueToOptions(unit: NSCalendar_Unit, value: number, date: globalThis.Date, options?: NSCalendar_Options): (globalThis.Date) | null
Swift declaration
func date(byAdding unit: NSCalendar.Unit, value: Int, to date: Date, options: NSCalendar.Options = []) -> Date?
method · iOS 8.0+

date

TypeScript
dateBySettingHourMinuteSecondOfOptions(h: number, m: number, s: number, date: globalThis.Date, opts?: NSCalendar_Options): (globalThis.Date) | null
Swift declaration
func date(bySettingHour h: Int, minute m: Int, second s: Int, of date: Date, options opts: NSCalendar.Options = []) -> Date?
method · iOS 8.0+

date

TypeScript
dateBySettingUnitValueOfOptions(unit: NSCalendar_Unit, v: number, date: globalThis.Date, opts?: NSCalendar_Options): (globalThis.Date) | null
Swift declaration
func date(bySettingUnit unit: NSCalendar.Unit, value v: Int, of date: Date, options opts: NSCalendar.Options = []) -> Date?
method

date

TypeScript
dateFrom(comps: DateComponents): (globalThis.Date) | null
Swift declaration
func date(from comps: DateComponents) -> Date?
method · iOS 8.0+

date

TypeScript
dateEraYearMonthDayHourMinuteSecondNanosecond(eraValue: number, yearValue: number, monthValue: number, dayValue: number, hourValue: number, minuteValue: number, secondValue: number, nanosecondValue: number): (globalThis.Date) | null
Swift declaration
func date(era eraValue: Int, year yearValue: Int, month monthValue: Int, day dayValue: Int, hour hourValue: Int, minute minuteValue: Int, second secondValue: Int, nanosecond nanosecondValue: Int) -> Date?
method · iOS 8.0+

date

TypeScript
dateEraYearForWeekOfYearWeekOfYearWeekdayHourMinuteSecondNanosecond(eraValue: number, yearValue: number, weekValue: number, weekdayValue: number, hourValue: number, minuteValue: number, secondValue: number, nanosecondValue: number): (globalThis.Date) | null
Swift declaration
func date(era eraValue: Int, yearForWeekOfYear yearValue: Int, weekOfYear weekValue: Int, weekday weekdayValue: Int, hour hourValue: Int, minute minuteValue: Int, second secondValue: Int, nanosecond nanosecondValue: Int) -> Date?
method · iOS 8.0+

enumerateDates

TypeScript
enumerateDates(start: globalThis.Date, comps: DateComponents, opts: NSCalendar_Options, block: ((arg0: (globalThis.Date) | null, arg1: boolean, arg2: NativeOut<boolean>) => void)): void
Swift declaration
func enumerateDates(startingAfter start: Date, matching comps: DateComponents, options opts: NSCalendar.Options = [], using block: (Date?, Bool, UnsafeMutablePointer<ObjCBool>) -> Void)
method · iOS 8.0+

getEra

TypeScript
getEraYearMonthDayFrom(eraValuePointer: (SDKHandle) | null, yearValuePointer: (SDKHandle) | null, monthValuePointer: (SDKHandle) | null, dayValuePointer: (SDKHandle) | null, date: globalThis.Date): void
Swift declaration
func getEra(_ eraValuePointer: UnsafeMutablePointer<Int>?, year yearValuePointer: UnsafeMutablePointer<Int>?, month monthValuePointer: UnsafeMutablePointer<Int>?, day dayValuePointer: UnsafeMutablePointer<Int>?, from date: Date)
method · iOS 8.0+

getEra

TypeScript
getEraYearForWeekOfYearWeekOfYearWeekdayFrom(eraValuePointer: (SDKHandle) | null, yearValuePointer: (SDKHandle) | null, weekValuePointer: (SDKHandle) | null, weekdayValuePointer: (SDKHandle) | null, date: globalThis.Date): void
Swift declaration
func getEra(_ eraValuePointer: UnsafeMutablePointer<Int>?, yearForWeekOfYear yearValuePointer: UnsafeMutablePointer<Int>?, weekOfYear weekValuePointer: UnsafeMutablePointer<Int>?, weekday weekdayValuePointer: UnsafeMutablePointer<Int>?, from date: Date)
method · iOS 8.0+

getHour

TypeScript
getHour(hourValuePointer: (SDKHandle) | null, minuteValuePointer: (SDKHandle) | null, secondValuePointer: (SDKHandle) | null, nanosecondValuePointer: (SDKHandle) | null, date: globalThis.Date): void
Swift declaration
func getHour(_ hourValuePointer: UnsafeMutablePointer<Int>?, minute minuteValuePointer: UnsafeMutablePointer<Int>?, second secondValuePointer: UnsafeMutablePointer<Int>?, nanosecond nanosecondValuePointer: UnsafeMutablePointer<Int>?, from date: Date)
init

init

TypeScript
static initCalendarIdentifier(ident: NSCalendar_Identifier): (NSCalendar) | null
Swift declaration
init?(calendarIdentifier ident: NSCalendar.Identifier)
method · iOS 8.0+

isDate

TypeScript
isDateEqualToToUnitGranularity(date1: globalThis.Date, date2: globalThis.Date, unit: NSCalendar_Unit): boolean
Swift declaration
func isDate(_ date1: Date, equalTo date2: Date, toUnitGranularity unit: NSCalendar.Unit) -> Bool
method · iOS 8.0+

isDate

TypeScript
isDateInSameDayAs(date1: globalThis.Date, date2: globalThis.Date): boolean
Swift declaration
func isDate(_ date1: Date, inSameDayAs date2: Date) -> Bool
method · iOS 8.0+

isDateInToday

TypeScript
isDateInToday(date: globalThis.Date): boolean
Swift declaration
func isDateInToday(_ date: Date) -> Bool
method · iOS 8.0+

isDateInTomorrow

TypeScript
isDateInTomorrow(date: globalThis.Date): boolean
Swift declaration
func isDateInTomorrow(_ date: Date) -> Bool
method · iOS 8.0+

isDateInWeekend

TypeScript
isDateInWeekend(date: globalThis.Date): boolean
Swift declaration
func isDateInWeekend(_ date: Date) -> Bool
method · iOS 8.0+

isDateInYesterday

TypeScript
isDateInYesterday(date: globalThis.Date): boolean
Swift declaration
func isDateInYesterday(_ date: Date) -> Bool
method

maximumRange

TypeScript
maximumRange(unit: NSCalendar_Unit): SDKHandle
Swift declaration
func maximumRange(of unit: NSCalendar.Unit) -> NSRange
method

minimumRange

TypeScript
minimumRange(unit: NSCalendar_Unit): SDKHandle
Swift declaration
func minimumRange(of unit: NSCalendar.Unit) -> NSRange
method · iOS 8.0+

nextDate

TypeScript
nextDateAfterMatchingOptions(date: globalThis.Date, comps: DateComponents, options?: NSCalendar_Options): (globalThis.Date) | null
Swift declaration
func nextDate(after date: Date, matching comps: DateComponents, options: NSCalendar.Options = []) -> Date?
method · iOS 8.0+

nextDate

TypeScript
nextDateAfterMatchingHourMinuteSecondOptions(date: globalThis.Date, hourValue: number, minuteValue: number, secondValue: number, options?: NSCalendar_Options): (globalThis.Date) | null
Swift declaration
func nextDate(after date: Date, matchingHour hourValue: Int, minute minuteValue: Int, second secondValue: Int, options: NSCalendar.Options = []) -> Date?
method · iOS 8.0+

nextDate

TypeScript
nextDateAfterMatchingValueOptions(date: globalThis.Date, unit: NSCalendar_Unit, value: number, options?: NSCalendar_Options): (globalThis.Date) | null
Swift declaration
func nextDate(after date: Date, matching unit: NSCalendar.Unit, value: Int, options: NSCalendar.Options = []) -> Date?
method · iOS 8.0+

nextWeekendStart

TypeScript
nextWeekendStart(tip: (SDKHandle) | null, options: NSCalendar_Options, date: globalThis.Date): { $ret: boolean; $out: { "datep": (NSDate) | null } }
Swift declaration
func nextWeekendStart(_ datep: AutoreleasingUnsafeMutablePointer<NSDate?>?, interval tip: UnsafeMutablePointer<TimeInterval>?, options: NSCalendar.Options = [], after date: Date) -> Bool

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

method

ordinality

TypeScript
ordinality(smaller: NSCalendar_Unit, larger: NSCalendar_Unit, date: globalThis.Date): number
Swift declaration
func ordinality(of smaller: NSCalendar.Unit, in larger: NSCalendar.Unit, for date: Date) -> Int
method

range

TypeScript
rangeOfInFor(smaller: NSCalendar_Unit, larger: NSCalendar_Unit, date: globalThis.Date): SDKHandle
Swift declaration
func range(of smaller: NSCalendar.Unit, in larger: NSCalendar.Unit, for date: Date) -> NSRange
method · iOS 2.0+

range

TypeScript
rangeOfStartIntervalFor(unit: NSCalendar_Unit, tip: (SDKHandle) | null, date: globalThis.Date): { $ret: boolean; $out: { "datep": (NSDate) | null } }
Swift declaration
func range(of unit: NSCalendar.Unit, start datep: AutoreleasingUnsafeMutablePointer<NSDate?>?, interval tip: UnsafeMutablePointer<TimeInterval>?, for date: Date) -> Bool

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

method · iOS 8.0+

range

TypeScript
rangeOfWeekendStartIntervalContaining(tip: (SDKHandle) | null, date: globalThis.Date): { $ret: boolean; $out: { "datep": (NSDate) | null } }
Swift declaration
func range(ofWeekendStart datep: AutoreleasingUnsafeMutablePointer<NSDate?>?, interval tip: UnsafeMutablePointer<TimeInterval>?, containing date: Date) -> Bool

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

method · iOS 8.0+

startOfDay

TypeScript
startOfDay(date: globalThis.Date): globalThis.Date
Swift declaration
func startOfDay(for date: Date) -> Date
get · iOS 5.0+

amSymbol

TypeScript
get amSymbol(): string
Swift declaration
var amSymbol: String { get }
get · iOS 5.0+

pmSymbol

TypeScript
get pmSymbol(): string
Swift declaration
var pmSymbol: String { get }
get

calendarIdentifier

TypeScript
get calendarIdentifier(): NSCalendar_Identifier
Swift declaration
var calendarIdentifier: NSCalendar.Identifier { get }
get · iOS 5.0+

eraSymbols

TypeScript
get eraSymbols(): Array<string>
Swift declaration
var eraSymbols: [String] { get }
get

firstWeekday

TypeScript
get firstWeekday(): number
Swift declaration
var firstWeekday: Int { get set }
set

firstWeekday

TypeScript
set firstWeekday(value: number)
Swift declaration
var firstWeekday: Int { get set }
get

locale

TypeScript
get locale(): (Locale) | null
Swift declaration
var locale: Locale? { get set }
set

locale

TypeScript
set locale(value: (Locale) | null)
Swift declaration
var locale: Locale? { get set }
get · iOS 5.0+

longEraSymbols

TypeScript
get longEraSymbols(): Array<string>
Swift declaration
var longEraSymbols: [String] { get }
get

minimumDaysInFirstWeek

TypeScript
get minimumDaysInFirstWeek(): number
Swift declaration
var minimumDaysInFirstWeek: Int { get set }
set

minimumDaysInFirstWeek

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

monthSymbols

TypeScript
get monthSymbols(): Array<string>
Swift declaration
var monthSymbols: [String] { get }
get · iOS 5.0+

quarterSymbols

TypeScript
get quarterSymbols(): Array<string>
Swift declaration
var quarterSymbols: [String] { get }
get · iOS 5.0+

shortMonthSymbols

TypeScript
get shortMonthSymbols(): Array<string>
Swift declaration
var shortMonthSymbols: [String] { get }
get · iOS 5.0+

shortQuarterSymbols

TypeScript
get shortQuarterSymbols(): Array<string>
Swift declaration
var shortQuarterSymbols: [String] { get }
get · iOS 5.0+

shortStandaloneMonthSymbols

TypeScript
get shortStandaloneMonthSymbols(): Array<string>
Swift declaration
var shortStandaloneMonthSymbols: [String] { get }
get · iOS 5.0+

shortStandaloneQuarterSymbols

TypeScript
get shortStandaloneQuarterSymbols(): Array<string>
Swift declaration
var shortStandaloneQuarterSymbols: [String] { get }
get · iOS 5.0+

shortStandaloneWeekdaySymbols

TypeScript
get shortStandaloneWeekdaySymbols(): Array<string>
Swift declaration
var shortStandaloneWeekdaySymbols: [String] { get }
get · iOS 5.0+

shortWeekdaySymbols

TypeScript
get shortWeekdaySymbols(): Array<string>
Swift declaration
var shortWeekdaySymbols: [String] { get }
get · iOS 5.0+

standaloneMonthSymbols

TypeScript
get standaloneMonthSymbols(): Array<string>
Swift declaration
var standaloneMonthSymbols: [String] { get }
get · iOS 5.0+

standaloneQuarterSymbols

TypeScript
get standaloneQuarterSymbols(): Array<string>
Swift declaration
var standaloneQuarterSymbols: [String] { get }
get · iOS 5.0+

standaloneWeekdaySymbols

TypeScript
get standaloneWeekdaySymbols(): Array<string>
Swift declaration
var standaloneWeekdaySymbols: [String] { get }
get

timeZone

TypeScript
get timeZone(): TimeZone
Swift declaration
var timeZone: TimeZone { get set }
set

timeZone

TypeScript
set timeZone(value: TimeZone)
Swift declaration
var timeZone: TimeZone { get set }
get · iOS 5.0+

veryShortMonthSymbols

TypeScript
get veryShortMonthSymbols(): Array<string>
Swift declaration
var veryShortMonthSymbols: [String] { get }
get · iOS 5.0+

veryShortStandaloneMonthSymbols

TypeScript
get veryShortStandaloneMonthSymbols(): Array<string>
Swift declaration
var veryShortStandaloneMonthSymbols: [String] { get }
get · iOS 5.0+

veryShortStandaloneWeekdaySymbols

TypeScript
get veryShortStandaloneWeekdaySymbols(): Array<string>
Swift declaration
var veryShortStandaloneWeekdaySymbols: [String] { get }
get · iOS 5.0+

veryShortWeekdaySymbols

TypeScript
get veryShortWeekdaySymbols(): Array<string>
Swift declaration
var veryShortWeekdaySymbols: [String] { get }
get · iOS 5.0+

weekdaySymbols

TypeScript
get weekdaySymbols(): Array<string>
Swift declaration
var weekdaySymbols: [String] { get }

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NSCalendar.init()

inherited init: cannot prove legal (class declares 2 custom initializers)

All Foundation types →