Date

public extension Date
  • Compares another date to this one, with a day (24 hours) granularity.

    Declaration

    Swift

    func isOnADayBefore(_ inDay: Date, calendar inCalendar: Calendar? = nil) -> Bool

    Parameters

    inDay

    The date against which we are comparing ourselves.

    calendar

    An optional (default is the current calendar) calendar instance, to use for the calculation.

    Return Value

    True, if this date is on a day prior to the one provided.

  • Compares another date to this one, with a day (24 hours) granularity.

    Declaration

    Swift

    func isOnADayAfter(_ inDay: Date, calendar inCalendar: Calendar? = nil) -> Bool

    Parameters

    inDay

    The date against which we are comparing ourselves.

    calendar

    An optional (default is the current calendar) calendar instance, to use for the calculation.

    Return Value

    True, if this date is on a day after the one provided.

  • Compares another date to this one, with a day (24 hours) granularity.

    Declaration

    Swift

    func isOnTheSameDayAs(_ inDay: Date, calendar inCalendar: Calendar? = nil) -> Bool

    Parameters

    inDay

    The date against which we are comparing ourselves.

    calendar

    An optional (default is the current calendar) calendar instance, to use for the calculation.

    Return Value

    True, if this date is the same day as the one provided.