Skip to content

docs(datetime): add range selection playgrounds - #4824

Open
OS-susmitabhowmik wants to merge 10 commits into
major-10.0from
ROU-12704-date-range
Open

OS-susmitabhowmik wants to merge 10 commits into
major-10.0from
ROU-12704-date-range

Conversation

@OS-susmitabhowmik

@OS-susmitabhowmik OS-susmitabhowmik commented Nov 3, 2026 •

Copy link
Copy Markdown

Description

This PR adds the playgrounds for the ion-datetime range selection work done in ionic-team/ionic-framework#31581.

The following changes were added:

  • Adds documentation and playgrounds for the new selectionMode="range" feature on ion-datetime, including basic usage and styling examples across all frameworks (JavaScript, Angular, React, Vue)
  • Updates the existing multiple date selection docs and demos to use selectionMode="multiple" instead of the deprecated multiple boolean prop
  • Adds a range styling playground demonstrating --range-background, range-start, range-end CSS shadow parts

Testing

  • To test use the dev build version 9.0.11-dev.11793736984.1580a194 from https://github.com/ionic-team/ionic-framework/actions/runs/41710956887
  • Run npm start and verify the Range Selection playground renders correctly on the datetime docs page
  • Verify the Range Styling playground renders correctly with custom styling applied
  • Verify the Multiple Date Selection playground still works with selectionMode="multiple"
  • Confirm all framework tabs (JavaScript, Angular, React, Vue) show correct code snippets for both range and multiple demos

…electionMode

Add range and range styling playgrounds with presentation="date"
selection-mode="range". Update multiple date selection to use the new
selectionMode="multiple" property instead of the deprecated multiple
prop.
@OS-susmitabhowmik
OS-susmitabhowmik requested a review from a team as a code owner November 3, 2026 19:17
@OS-susmitabhowmik
OS-susmitabhowmik requested review from ShaneK and removed request for a team November 3, 2026 19:17
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-docs Ready Ready Preview Nov 5, 2026 9:17pm UTC

Request Review

Comment thread docs/api/datetime.mdx Resolved
Comment thread docs/api/datetime.mdx Resolved
Comment thread docs/api/datetime.mdx Resolved
Use passive voice and "Clicking" to match surrounding sections. Clarify
that the range is the value (not "returned") and document disabled-date
behavior.
…ules

Border-radius rules break in RTL and the framework already handles
start/end circles. The range-track pseudo-element is internal and
should not be documented.

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShaneK ShaneK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good so far! Just a couple of things on how range selection behaves.

Comment thread docs/api/datetime.mdx Outdated

## Range Selection {/* #range-selection */}

If the `selectionMode` property is set to `"range"`, a range of dates can be selected from the calendar picker. Clicking a date sets the start of the range, and clicking another date sets the end. The `value` is an array of two ISO 8601 strings, `[start, end]`. A range can't include a disabled date, so clicking a date past one starts a new range instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this only holds for the first two clicks in order. Clicking a date before the start begins a new range, even on the second click, so the 15th then the 10th gives Jun 10 - End date. Once the range is complete, clicking inside or after it moves the end, so Jun 10 - 20 becomes Jun 10 - 25 after clicking the 25th. Could we cover those two cases? Otherwise most people would expect a third click to start over.

Comment thread docs/api/datetime.mdx Outdated
## Multiple Date Selection {/* #multiple-date-selection */}

If the `multiple` property is set to `true`, multiple dates can be selected from the calendar picker. Clicking a selected date will deselect it.
If the `selectionMode` property is set to `"multiple"`, multiple dates can be selected from the calendar picker. Clicking a selected date will deselect it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a short note here that multiple is deprecated in favor of selectionMode="multiple"? It logs a warning in the framework, but someone already using multiple="true" wouldn't know to switch from this section alone. Up to you!

Comment thread docs/api/datetime.mdx
## Range Selection {/* #range-selection */}

If the `selectionMode` property is set to `"range"`, a range of dates can be selected from the calendar picker. Clicking a date sets the start of the range, and clicking another date sets the end. The `value` is an array of two ISO 8601 strings, `[start, end]`. A range can't include a disabled date, so clicking a date past one starts a new range instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we mention that value and ionChange don't update until both dates are picked? With showDefaultButtons the confirm button also stays disabled until then. I think that's the first thing someone listening for ionChange would trip over. Also, value accepts [start] as a partial range, which matches the framework's value doc, so "an array of two ISO 8601 strings" is a bit narrower than what it supports.

…ection

Clarify range selection click behavior (before-start resets, after-
complete moves end), note that value/ionChange update only after both
dates are picked, accept partial [start] value, and add multiple
property deprecation note.

This branch was successfully deployed

1 active deployment
Preview — 49e2b3b0 Deployed Nov 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants