Instance Method

isDateInYesterday(_:)

Returns a Boolean value indicating whether the given date is within yesterday.

Declaration

func isDateInYesterday(_ date: Date) -> Bool

Parameters

date

The specified date.

Return Value

true if the given date is within yesterday, as defined by the calendar and calendar’s locale; otherwise, false.

See Also

Comparing Dates

func compare(Date, to: Date, toGranularity: Calendar.Component)

Compares two dates down to the specified component.

func isDate(Date, equalTo: Date, toGranularity: Calendar.Component)

Returns a Boolean value indicating whether two dates are equal down to the specified component.

func isDate(Date, inSameDayAs: Date)

Returns a Boolean value indicating whether a date is within the same day as another date.

func isDateInToday(Date)

Returns a Boolean value indicating whether the given date is within today.

func isDateInTomorrow(Date)

Returns a Boolean value indicating whether the given date is within tomorrow.

func isDateInWeekend(Date)

Returns a Boolean value indicating whether the given date is within a weekend period.