You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(datetime): add selectionMode="range", monthNavigation="scroll", 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.
* The mode determines the platform behaviors of the component.
1207
+
* Controls the month navigation mode when using a grid-style layout. - `"arrows"` (default) preserves the existing prev/next button behaviour. - `"scroll"` swaps the horizontal scroll axis to vertical. The `previous-button` and `next-button` shadow parts remain in the DOM and keyboard-focusable in both modes.
1208
+
* @default 'arrows'
1208
1209
*/
1209
-
"mode"?: "ios" | "md";
1210
+
"monthNavigation": 'arrows' | 'scroll';
1210
1211
/**
1211
1212
* Values used to create the list of selectable months. By default the month values range from `1` to `12`. However, to control exactly which months to display, the `monthValues` input can take a number, an array of numbers, or a string of comma separated numbers. For example, if only summer months should be shown, then this input value would be `monthValues="6,7,8"`. Note that month numbers do *not* have a zero-based index, meaning January's value is `1`, and December's is `12`.
1212
1213
*/
1213
1214
"monthValues"?: number[] | number | string;
1215
+
/**
1216
+
* Controls the month/year picker overlay style when using a grid-style layout. - `"wheel"` (default) preserves the existing `ion-picker-column` behaviour. - `"grid"` replaces the wheel columns with a month name grid and a year grid shown simultaneously inside the existing toggle overlay.
1217
+
* @default 'wheel'
1218
+
*/
1219
+
"monthYearPickerView": 'wheel' | 'grid';
1214
1220
/**
1215
1221
* If `true`, multiple dates can be selected at once. Only applies to `presentation="date"` and `preferWheel="false"`.
1222
+
* @deprecated Use `selectionMode="multiple"` instead.
* @param startDate A valid [ISO-8601 string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format) to reset the datetime state to.
1242
1249
*/
1243
1250
"reset": (startDate?: string) => Promise<void>;
1251
+
/**
1252
+
* Controls date selection behaviour when using a grid-style layout. - `"multiple"` enables toggling of individual dates (replaces the deprecated `multiple` boolean). - `"range"` enables start/end date range selection. `value` will emit a two-element ISO 8601 string array `[startDate, endDate]` once both dates are selected. Only applies to `presentation="date"` and `preferWheel="false"`. Logs a warning if used with any other `presentation` or with `preferWheel="true"`.
1253
+
*/
1254
+
"selectionMode"?: 'multiple' | 'range';
1244
1255
/**
1245
1256
* If `true`, the datetime calendar displays a six-week (42-day) layout, including days from the previous and next months to fill the grid. These adjacent days are selectable unless disabled.
* The theme determines the visual appearance of the component.
1276
-
*/
1277
-
"theme"?: "ios" | "md" | "ionic";
1278
1285
/**
1279
1286
* A callback used to format the header text that shows how many dates are selected. Only used if there are 0 or more than 1 selected (i.e. unused for exactly 1). By default, the header text is set to "numberOfDates days". See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
* The mode determines the platform behaviors of the component.
7268
+
* Controls the month navigation mode when using a grid-style layout. - `"arrows"` (default) preserves the existing prev/next button behaviour. - `"scroll"` swaps the horizontal scroll axis to vertical. The `previous-button` and `next-button` shadow parts remain in the DOM and keyboard-focusable in both modes.
7269
+
* @default 'arrows'
7262
7270
*/
7263
-
"mode"?: "ios" | "md";
7271
+
"monthNavigation"?: 'arrows' | 'scroll';
7264
7272
/**
7265
7273
* Values used to create the list of selectable months. By default the month values range from `1` to `12`. However, to control exactly which months to display, the `monthValues` input can take a number, an array of numbers, or a string of comma separated numbers. For example, if only summer months should be shown, then this input value would be `monthValues="6,7,8"`. Note that month numbers do *not* have a zero-based index, meaning January's value is `1`, and December's is `12`.
7266
7274
*/
7267
7275
"monthValues"?: number[] | number | string;
7276
+
/**
7277
+
* Controls the month/year picker overlay style when using a grid-style layout. - `"wheel"` (default) preserves the existing `ion-picker-column` behaviour. - `"grid"` replaces the wheel columns with a month name grid and a year grid shown simultaneously inside the existing toggle overlay.
7278
+
* @default 'wheel'
7279
+
*/
7280
+
"monthYearPickerView"?: 'wheel' | 'grid';
7268
7281
/**
7269
7282
* If `true`, multiple dates can be selected at once. Only applies to `presentation="date"` and `preferWheel="false"`.
7283
+
* @deprecated Use `selectionMode="multiple"` instead.
* Controls date selection behaviour when using a grid-style layout. - `"multiple"` enables toggling of individual dates (replaces the deprecated `multiple` boolean). - `"range"` enables start/end date range selection. `value` will emit a two-element ISO 8601 string array `[startDate, endDate]` once both dates are selected. Only applies to `presentation="date"` and `preferWheel="false"`. Logs a warning if used with any other `presentation` or with `preferWheel="true"`.
7337
+
*/
7338
+
"selectionMode"?: 'multiple' | 'range';
7321
7339
/**
7322
7340
* If `true`, the datetime calendar displays a six-week (42-day) layout, including days from the previous and next months to fill the grid. These adjacent days are selectable unless disabled.
* The theme determines the visual appearance of the component.
7353
-
*/
7354
-
"theme"?: "ios" | "md" | "ionic";
7355
7369
/**
7356
7370
* A callback used to format the header text that shows how many dates are selected. Only used if there are 0 or more than 1 selected (i.e. unused for exactly 1). By default, the header text is set to "numberOfDates days". See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
0 commit comments