BusinessDurationRequest

public class BusinessDurationRequest : RequestObject

businessduration – Calculate business days in a specified date range The businessduration service can be used to calculate the number of business days between a specified start date and end date. When you query the businessduration service with a placeid or a country, a start date and an end date the service will return the number of business days in that date range by excluding public holidays and weekends. Furthermore, you can apply additional filters such as individual days and whether or not the calculation should include the filter result or exclude it.

     businessDurationRequest = BusinessDurationRequest()
     businessDurationRequest.placeId = "norway/Oslo"
     businessDurationRequest.country = "no"
  • Specify the ID of the location you would like to calculate the business duration. The ID is used to find what holidays are applicable for the given place so the calculation can exclude or include those results.

    Precondition

    either the placeid or the country parameter has to be specified.

    Note

    It is also possible to specify coordinates or IATA/ICAO codes for airports, see the documentation for the type Location Id for detailed information.

    Declaration

    Swift

    public var placeId: String!
  • Specify the country for which you would like to calculate the business date.

    Precondition

    either the placeid or the country parameter have to be specified.

    Declaration

    Swift

    public var country: String!
  • Specify the state in the given country you want to calculate the business date.

    Precondition

    only if the country parameter has been specified.

    Declaration

    Swift

    public var state: String?
  • Specify the ISO 8601 date for the date you want to calculate to.

    Declaration

    Swift

    public var startDt: Date!
  • Specify the ISO 8601 date for the date you want to calculate to.

    1 Type: String/ISO8601 Date
    

    Declaration

    Swift

    public var endDt: Date!
  • Specify whether the result should be calculated by including instead of excluding the days specified by filter.

    Declaration

    Swift

    public var include: Bool
  • Choose a set of types or days you want to filter on.

    Declaration

    Swift

    public var filter: [BussinesDaysFilterType]
  • Whether or not the last date (enddt) should be counted in the result.

    Declaration

    Swift

    public var includelAStdate: Bool
  • The preferred language for the texts. An error will be raised if the language code cannot be recognized. In case the text for a specific event cannot be retrieved in the requested language it will be returned in English instead. This is also the default language.

    Note

    NOTE:In case you have specific needs for a certain language/translation, please email api@timeanddate.com.

    Note

    NOTE:Due to technical limitations, time zone names cannot be translated at the moment.

    Declaration

    Swift

    public var lang: String
  • Adds verbose time specification to all ISO 8601 time stamps. - Type: Boolean - Accepted values: true or false - Default value: true

    Declaration

    Swift

    public var verbosetime: Bool