Calendar

struct Calendar : Hashable, Equatable, ReferenceConvertible, _MutableBoxing
  • Mechanica

    Returns the quarter for a given date.

    Example:

    Calendar.current.quarter(from: Date()) -> 4 // date in fourth quarter of the year.
    

    Declaration

    Swift

    public func quarter(from date: Date) -> Int
  • Mechanica

    Checks if date is is within the current week.

    Declaration

    Swift

    public func isDateInCurrentWeek(_ date: Date) -> Bool
  • Mechanica

    Checks if date is is within the current month.

    Declaration

    Swift

    public func isDateInCurrentMonth(_ date: Date) -> Bool
  • Mechanica

    Checks if date is is within the current year.

    Declaration

    Swift

    public func isDateInCurrentYear(_ date: Date) -> Bool
  • Mechanica

    Checks if date is is within a weekday period.

    Declaration

    Swift

    public func isDateInWorkDay(_ date: Date) -> Bool