Skip to content
DocsDashboard

Dates (date_range)

A calendar for choosing one date or a date range, optionally with times: hotel stays, trips (from/to), due dates, a meeting time on a chosen day.

When to use it: The person picks a date, a check-in and check-out range, or a trip from and to, on a calendar with limits and unavailable days. Set withTime: true to also pick a time of day: a due date and time, or a meeting time on a chosen day.

When not to use it: Do not use it when you already have specific free slots or a few fixed options to offer (use time_slots), or for a single date the person can just type in chat.

Gather first:

  • Whether you need one date (mode: "single") or a start and end ("range"), and whether times matter (withTime: true).
  • The earliest and latest dates you can work with, and any dates that are not possible.

Writing good content:

  • Set minDate and maxDate to the real window and list impossible days in disabledDates, so the person cannot pick a date you cannot use.
  • For stays, set minNights and maxNights when the place requires them. For any other period (a trip, time off, a deadline window) set stay: false, so the page does not count nights.
  • Use dayNotes for a very short note under a day, such as a nightly price, only when you have it for those days.
  • Forms: a due date and time is mode: "single" with withTime; a trip leaving Monday and returning Friday is mode: "range", stay: false; a hotel stay is mode: "range" with no withTime; "November 4th at 5 pm" is single with withTime.
  • With withTime the person picks times in timeStep minutes (5, 10, 15, 30 or 60; default 15), optionally between minTime and maxTime. A range may end the same day if the end time is later; night limits still count dates only.
  • Set timeZone (IANA, e.g. "America/New_York") when the times belong to a place. The answer then also has ISO timestamps with the UTC offset for that day (dateTime, or start and end), daylight saving included, so you do not convert them. Without it you get only the plain "HH:MM" times.

Fields

Every page also has version (always 1), title, and optionally description, branding, cover (a header photo), expiresAt and returnLink; see Page fields. These are the fields of page (the page type and its data):

FieldDescription
mode"single" | "range", required. "single" picks one date; "range" picks a start and an end date.
withTimeboolean. Also ask for a time of day, after the date. single + withTime: a due date and time, or a meeting time on a chosen day (result { date, time }). range + withTime: a trip leaving and returning at set times, e.g. Monday 9:00 to Friday 17:00 (result { startDate, startTime, endDate, endTime }); the end may be the same day if its time is later. If you have specific free slots, use time_slots instead. Default false (dates only).
timeZonestring. withTime only. IANA zone the times are in, e.g. "America/New_York". The result then also has ISO timestamps with offset (dateTime, or start and end), DST included. Omit for plain local times.
timeStep5 | 10 | 15 | 30 | 60. withTime only. Minutes between selectable times: 5, 10, 15, 30 or 60. Default 15.
minTimestring. withTime only. Earliest time of day, e.g. "09:00". Must fit timeStep.
maxTimestring. withTime only. Latest time of day, e.g. "17:00". Must fit timeStep.
minDatestring. Earliest selectable date. Days before it are disabled. Defaults to no limit.
maxDatestring. Latest selectable date. Days after it are disabled. Defaults to no limit.
disabledDatesstring[]. Dates that cannot be chosen, e.g. days with no availability. A range cannot span a disabled date. Limits: at most 400 items.
minNightsinteger. Range mode only: fewest nights (endDate minus startDate). Defaults to 1, or 0 with withTime (same-day ranges allowed). Limits: 1-365.
maxNightsinteger. Range mode only: most nights. Defaults to no limit. Limits: 1-365.
stayboolean. Range mode only. Omit or true for a stay (check-in to check-out): the page counts and shows nights. false for any other period (a trip, time off, a deadline window): no night count, and minNights/maxNights read as days between the dates.
dayNotesobject[]. Optional small note per date, usually a price, e.g. { "date": "2026-11-03", "note": "$129" }. Limits: at most 400 items.
dayNotes[].datestring, required. Calendar date as "YYYY-MM-DD", e.g. "2026-11-03". No time or time zone.
dayNotes[].notestring, required. Very short text under the day number, e.g. "$129". Max 8 characters. Limits: 1-8 characters.
defaultValueobject. Optional preselected answer. Use { date } (plus time with withTime) in single mode, or { startDate, endDate } (plus startTime, endTime with withTime) in range mode.
defaultValue (variant 1).datestring, required. The chosen date, "YYYY-MM-DD".
defaultValue (variant 1).timestring. The chosen time, "HH:MM". Present only when the spec sets withTime.
defaultValue (variant 1).dateTimeISO 8601 timestamp. date and time as an ISO 8601 timestamp with the UTC offset of timeZone. Present only when the spec sets timeZone.
defaultValue (variant 2).startDatestring, required. First day of the range (check-in), "YYYY-MM-DD".
defaultValue (variant 2).startTimestring. Start time, "HH:MM". Present only when the spec sets withTime.
defaultValue (variant 2).endDatestring, required. Last day of the range (check-out), "YYYY-MM-DD". Nights = endDate minus startDate.
defaultValue (variant 2).endTimestring. End time, "HH:MM". Present only when the spec sets withTime.
defaultValue (variant 2).startISO 8601 timestamp. Start as an ISO 8601 timestamp with the UTC offset of timeZone. Present only when the spec sets timeZone.
defaultValue (variant 2).endISO 8601 timestamp. End as an ISO 8601 timestamp with the UTC offset of timeZone. Present only when the spec sets timeZone.

Why these are required: It decides the result shape ({ date } or { startDate, endDate }).

When optional fields are left out: No limits; at least 1 night in range mode (0 with withTime, so a same-day range works); date only, no time of day (withTime: true adds a time after the date, and timeZone makes the result carry ISO timestamps the server derives itself; timeStep defaults to 15 minutes, minTime/maxTime bound the time of day); a range is a stay and the page counts nights (stay: false drops the night count for other periods); nothing preselected.

Minimal example

Only the required fields:

{
  "version": 1,
  "title": "When should the piano tuner come?",
  "page": {
    "type": "date_range",
    "mode": "single"
  }
}

Full example

{
  "version": 1,
  "title": "Pick your dates at Harbor Light Inn",
  "description": "Nightly rates are shown under each day. Stays are 2 to 7 nights.",
  "branding": {
    "name": "Juniper Concierge",
    "accentColor": "#0050d8"
  },
  "page": {
    "type": "date_range",
    "mode": "range",
    "minDate": "2026-11-02",
    "maxDate": "2027-01-31",
    "minNights": 2,
    "maxNights": 7,
    "disabledDates": [
      "2026-11-12",
      "2026-11-13",
      "2026-11-27"
    ],
    "dayNotes": [
      {
        "date": "2026-11-03",
        "note": "$129"
      },
      {
        "date": "2026-11-04",
        "note": "$129"
      },
      {
        "date": "2026-11-05",
        "note": "$139"
      },
      {
        "date": "2026-11-06",
        "note": "$159"
      },
      {
        "date": "2026-11-07",
        "note": "$189"
      },
      {
        "date": "2026-11-08",
        "note": "$189"
      },
      {
        "date": "2026-11-09",
        "note": "$149"
      },
      {
        "date": "2026-11-10",
        "note": "$129"
      },
      {
        "date": "2026-11-11",
        "note": "$129"
      },
      {
        "date": "2026-11-12",
        "note": "$135"
      },
      {
        "date": "2026-11-13",
        "note": "$155"
      },
      {
        "date": "2026-11-14",
        "note": "$185"
      },
      {
        "date": "2026-11-15",
        "note": "$189"
      },
      {
        "date": "2026-11-16",
        "note": "$149"
      },
      {
        "date": "2026-11-17",
        "note": "$129"
      },
      {
        "date": "2026-11-18",
        "note": "$129"
      },
      {
        "date": "2026-11-19",
        "note": "$129"
      },
      {
        "date": "2026-11-20",
        "note": "$139"
      }
    ]
  }
}

Result

When the person submits, the result has these fields:

FieldDescription
(variant 1).datestring, required. The chosen date, "YYYY-MM-DD".
(variant 1).timestring. The chosen time, "HH:MM". Present only when the spec sets withTime.
(variant 1).dateTimeISO 8601 timestamp. date and time as an ISO 8601 timestamp with the UTC offset of timeZone. Present only when the spec sets timeZone.
(variant 2).startDatestring, required. First day of the range (check-in), "YYYY-MM-DD".
(variant 2).startTimestring. Start time, "HH:MM". Present only when the spec sets withTime.
(variant 2).endDatestring, required. Last day of the range (check-out), "YYYY-MM-DD". Nights = endDate minus startDate.
(variant 2).endTimestring. End time, "HH:MM". Present only when the spec sets withTime.
(variant 2).startISO 8601 timestamp. Start as an ISO 8601 timestamp with the UTC offset of timeZone. Present only when the spec sets timeZone.
(variant 2).endISO 8601 timestamp. End as an ISO 8601 timestamp with the UTC offset of timeZone. Present only when the spec sets timeZone.

For the full example above, a result could be:

{
  "startDate": "2026-11-03",
  "endDate": "2026-11-06"
}

Send it

The pagesystems package and MCP

With the pagesystems package (eve, AI SDK and other frameworks) or the MCP server, the model calls get_page_type_schema with "date_range" (the same JSON as GET /v1/page-types/date_range), then create_page with this input (no version or branding; branding comes from your dashboard):

{
  "title": "Pick your dates at Harbor Light Inn",
  "description": "Nightly rates are shown under each day. Stays are 2 to 7 nights.",
  "page": {
    "type": "date_range",
    "mode": "range",
    "minDate": "2026-11-02",
    "maxDate": "2027-01-31",
    "minNights": 2,
    "maxNights": 7,
    "disabledDates": [
      "2026-11-12",
      "2026-11-13",
      "2026-11-27"
    ],
    "dayNotes": [
      {
        "date": "2026-11-03",
        "note": "$129"
      },
      {
        "date": "2026-11-04",
        "note": "$129"
      },
      {
        "date": "2026-11-05",
        "note": "$139"
      },
      {
        "date": "2026-11-06",
        "note": "$159"
      },
      {
        "date": "2026-11-07",
        "note": "$189"
      },
      {
        "date": "2026-11-08",
        "note": "$189"
      },
      {
        "date": "2026-11-09",
        "note": "$149"
      },
      {
        "date": "2026-11-10",
        "note": "$129"
      },
      {
        "date": "2026-11-11",
        "note": "$129"
      },
      {
        "date": "2026-11-12",
        "note": "$135"
      },
      {
        "date": "2026-11-13",
        "note": "$155"
      },
      {
        "date": "2026-11-14",
        "note": "$185"
      },
      {
        "date": "2026-11-15",
        "note": "$189"
      },
      {
        "date": "2026-11-16",
        "note": "$149"
      },
      {
        "date": "2026-11-17",
        "note": "$129"
      },
      {
        "date": "2026-11-18",
        "note": "$129"
      },
      {
        "date": "2026-11-19",
        "note": "$129"
      },
      {
        "date": "2026-11-20",
        "note": "$139"
      }
    ]
  }
}

REST

curl https://pagesystems.ai/v1/pages \
  -H "Authorization: Bearer $PAGE_SYSTEMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"spec":{"version":1,"title":"Pick your dates at Harbor Light Inn","description":"Nightly rates are shown under each day. Stays are 2 to 7 nights.","branding":{"name":"Juniper Concierge","accentColor":"#0050d8"},"page":{"type":"date_range","mode":"range","minDate":"2026-11-02","maxDate":"2027-01-31","minNights":2,"maxNights":7,"disabledDates":["2026-11-12","2026-11-13","2026-11-27"],"dayNotes":[{"date":"2026-11-03","note":"$129"},{"date":"2026-11-04","note":"$129"},{"date":"2026-11-05","note":"$139"},{"date":"2026-11-06","note":"$159"},{"date":"2026-11-07","note":"$189"},{"date":"2026-11-08","note":"$189"},{"date":"2026-11-09","note":"$149"},{"date":"2026-11-10","note":"$129"},{"date":"2026-11-11","note":"$129"},{"date":"2026-11-12","note":"$135"},{"date":"2026-11-13","note":"$155"},{"date":"2026-11-14","note":"$185"},{"date":"2026-11-15","note":"$189"},{"date":"2026-11-16","note":"$149"},{"date":"2026-11-17","note":"$129"},{"date":"2026-11-18","note":"$129"},{"date":"2026-11-19","note":"$129"},{"date":"2026-11-20","note":"$139"}]}}}'

Validation errors

A spec that does not validate is refused with 400 invalid_spec. The message names each problem and its path, so a model can fix the spec and try again. For example:

Leaving out the required field mode:

✖ Invalid option: expected one of "single"|"range"
  → at page.mode

Misspelling a field name (unknown keys are rejected):

✖ Unrecognized key: "colour"
  → at page