Day

public struct Day : Codable, Hashable

Opening hours on a particular day of the week (with a special case for public holidays).

  • day

    Undocumented

    Declaration

    Swift

    public let day: DayOfWeek
  • Undocumented

    Declaration

    Swift

    public let times: [Time]
  • Undocumented

    Declaration

    Swift

    public init(day: DayOfWeek, times: [Time])
  • Undocumented

    See more

    Declaration

    Swift

    public struct Time : Codable, Hashable
  • Undocumented

    See more

    Declaration

    Swift

    public enum DayOfWeek : String, Codable
  • Checks if provided date is covered by this particular day

    Warning

    This does not cover public holidays. If this object represents a public holiday, the return value is always false.

    Declaration

    Swift

    public func contains(_ date: Date, in timeZone: TimeZone) -> Bool

    Parameters

    date

    Date to check

    timeZone

    Time zone of the date object

    Return Value

    If date is covered by this particular day.

  • Checks if opening hour specify that the provided that is open.

    Warning

    This does not cover public holidays. If date is on a public holiday, the day of the week will be used.

    Declaration

    Swift

    public func isOpen(at date: Date, in timeZone: TimeZone) -> Bool

    Parameters

    date

    Date to check

    Return Value

    Whether open on provided date