<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "ApplePayontheWeb",
  "identifier" : "/documentation/ApplePayontheWeb/ApplePayShippingMethod/dateComponentsRange",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Apple Pay on the Web"
    ],
    "preciseIdentifier" : "instp/ApplePayShippingMethod/dateComponentsRange"
  },
  "title" : "dateComponentsRange"
}
-->

# dateComponentsRange

The expected range of dates for shipping or picking up an item.

```
ApplePayDateComponentsRange dateComponentsRange;
```

## Discussion

Use this object to set the expected date range for shipping a package, or the time an item is available for pickup. The payment sheet displays the range as part of the shipping method on the main sheet. When assembling the date components, provide absolute dates to represent the range.

The example code below shows setting a two day time range for shipping a package that starts three days from today:

```javascript
let shippingStart = new Date;
shippingStart.setDate(shippingStart.getDate() + 3);

let shippingEnd = new Date;
shippingEnd.setDate(shippingEnd.getDate() + 5);

let applePayShippingMethod = {
    amount: "0.00",
    dateComponentsRange: {
        startDateComponents: {
            year: shippingStart.getFullYear(),
            // Because the JavaScript getMonth() function is 0-based, add 1 to return a 1-based month.
            months: shippingStart.getMonth() + 1,
            days: shippingStart.getDate(),
        },
        endDateComponents: {
            year: shippingEnd.getFullYear(),
            months: shippingEnd.getMonth() + 1,
            days: shippingEnd.getDate(),
        },
    },
    detail: "Tickets sent to your address",
    identifier: "delivery",
    label: "Delivery",
};
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)