Skip to content

feat(datetime): add additional options for vertical scroll, range selection, and new month/year view#31255

Draft
OS-susmitabhowmik wants to merge 11 commits into
nextfrom
ROU-12867-POC-ion-datetime
Draft

feat(datetime): add additional options for vertical scroll, range selection, and new month/year view#31255
OS-susmitabhowmik wants to merge 11 commits into
nextfrom
ROU-12867-POC-ion-datetime

Conversation

@OS-susmitabhowmik

@OS-susmitabhowmik OS-susmitabhowmik commented Jun 30, 2026

Copy link
Copy Markdown

Issue number: resolves internal


What is the current behavior?

What is the new behavior?

This PR is a proof of concept for adding the following features to the ion-datetime component:

  • Vertical scroll rather than arrows for navigation
  • Date range selection
  • An updated month/year view

Does this introduce a breaking change?

  • Yes
  • No

Other information

OS-susmitabhowmik and others added 8 commits June 30, 2026 10:20
…and monthYearPickerView="grid"

Introduces three new opt-in props to ion-datetime:

selectionMode="range"
- First tap sets the range start; second tap commits the range and
  emits ionChange with a two-element ISO array [start, end]
- Second tap before first auto-swaps if needed so start is always earlier
- Third tap resets and starts a new range
- Deprecates the `multiple` boolean in favour of selectionMode="multiple"
- Range state (isRangeStart, isInRange, isRangeEnd) flows through
  getCalendarDayState() and is exposed as CSS classes on day buttons and
  ::before pseudo-element track on their wrapper cells

monthNavigation="scroll"
- Replaces the horizontal 3-month swipe window with a free-scrolling
  vertical list of ~13 months (+-6 from the working month, clamped to
  min/max)
- Each month card renders its own heading and days-of-week row inline
- A debounced scroll listener updates workingParts and the visually-
  hidden aria-live region as the user scrolls
- Arrow buttons are hidden in this mode (display: none)

monthYearPickerView="grid"
- Replaces the wheel picker overlay with a month name grid (3 col x 4
  row) and a paginated year grid (4 col x 6 row, 24 years per page)
- Year pages are navigated with prev/next arrow buttons; the page resets
  to the one containing the working year each time the picker opens
- Also applied to month/month-year/year presentations which previously
  hardcoded the wheel picker regardless of the prop

Adds unit tests for the new range state logic and E2E test files with
index.html pages for all three features.
Remove destructured { page } from test callbacks in the three new
datetime E2E test files where page was declared but never referenced
in the test body, resolving TypeScript "declared but its value is never
read" errors that were breaking the build.
Fix four issues found via CI:

- selectionMode="range": first click was falling through to confirm()
  and emitting ionChange with a partial { start } range. Add an early
  return so ionChange only fires after the second click when both start
  and end are committed.

- month-navigation scroll mode tests: .calendar-month-year is not
  rendered in scroll mode (minimal header only); switch programmatic
  nextMonth/prevMonth tests to use .calendar-month-year-announce.

- month-year-grid month cell selector: the year grid element carries
  both month-year-grid and month-year-grid-years classes, so
  .month-year-grid .month-year-grid-cell was matching year cells too
  (19 instead of 12). Switch all month-cell locators to
  [aria-label="Select month"] .month-year-grid-cell.

- month-year-grid year cells test: toHaveCount(expect.any(Number)) is
  not valid Playwright API; replace with a plain count assertion.
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Jul 1, 2026 1:17am

Request Review

@github-actions github-actions Bot added package: core @ionic/core package package: angular @ionic/angular package package: vue @ionic/vue package package: react @ionic/react package labels Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package package: react @ionic/react package package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants