From 5ecd33c81fb7cf2d756cee9fc0d93380d4ca1403 Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Fri, 6 Feb 2026 13:31:33 -0800 Subject: [PATCH 1/4] feat(datetime): add new calendar parts --- .../angular/example_component_css.md | 23 ++++++++++++++++++- .../styling/calendar-header/demo.html | 21 +++++++++++++++++ .../styling/calendar-header/javascript.md | 23 ++++++++++++++++++- .../styling/calendar-header/react/main_css.md | 23 ++++++++++++++++++- .../datetime/styling/calendar-header/vue.md | 21 +++++++++++++++++ 5 files changed, 108 insertions(+), 3 deletions(-) diff --git a/static/usage/v8/datetime/styling/calendar-header/angular/example_component_css.md b/static/usage/v8/datetime/styling/calendar-header/angular/example_component_css.md index f95379ddaa..ab447447cb 100644 --- a/static/usage/v8/datetime/styling/calendar-header/angular/example_component_css.md +++ b/static/usage/v8/datetime/styling/calendar-header/angular/example_component_css.md @@ -1,9 +1,30 @@ ```css /* - * Custom Datetime Calendar Header Part + * Custom Datetime Calendar Header Parts * ------------------------------------------- */ +ion-datetime::part(calendar-header) { + background-color: orange; +} + ion-datetime::part(month-year-button) { background-color: lightblue; } + +ion-datetime::part(prev-next-buttons) { + background-color: firebrick; +} + +ion-datetime::part(prev-button) { + color: white; +} + +ion-datetime::part(next-button) { + color: black; +} + +ion-datetime::part(days-of-week) { + background-color: #9ad162; + color: white; +} ``` diff --git a/static/usage/v8/datetime/styling/calendar-header/demo.html b/static/usage/v8/datetime/styling/calendar-header/demo.html index 331140d4bb..96c4861828 100644 --- a/static/usage/v8/datetime/styling/calendar-header/demo.html +++ b/static/usage/v8/datetime/styling/calendar-header/demo.html @@ -15,9 +15,30 @@ * ------------------------------------------- */ + ion-datetime::part(calendar-header) { + background-color: orange; + } + ion-datetime::part(month-year-button) { background-color: lightblue; } + + ion-datetime::part(prev-next-buttons) { + background-color: firebrick; + } + + ion-datetime::part(prev-button) { + color: white; + } + + ion-datetime::part(next-button) { + color: black; + } + + ion-datetime::part(days-of-week) { + background-color: #9ad162; + color: white; + } diff --git a/static/usage/v8/datetime/styling/calendar-header/javascript.md b/static/usage/v8/datetime/styling/calendar-header/javascript.md index fc936e5efe..4bd155c4f8 100644 --- a/static/usage/v8/datetime/styling/calendar-header/javascript.md +++ b/static/usage/v8/datetime/styling/calendar-header/javascript.md @@ -3,11 +3,32 @@ ``` diff --git a/static/usage/v8/datetime/styling/calendar-header/react/main_css.md b/static/usage/v8/datetime/styling/calendar-header/react/main_css.md index f95379ddaa..ab447447cb 100644 --- a/static/usage/v8/datetime/styling/calendar-header/react/main_css.md +++ b/static/usage/v8/datetime/styling/calendar-header/react/main_css.md @@ -1,9 +1,30 @@ ```css /* - * Custom Datetime Calendar Header Part + * Custom Datetime Calendar Header Parts * ------------------------------------------- */ +ion-datetime::part(calendar-header) { + background-color: orange; +} + ion-datetime::part(month-year-button) { background-color: lightblue; } + +ion-datetime::part(prev-next-buttons) { + background-color: firebrick; +} + +ion-datetime::part(prev-button) { + color: white; +} + +ion-datetime::part(next-button) { + color: black; +} + +ion-datetime::part(days-of-week) { + background-color: #9ad162; + color: white; +} ``` diff --git a/static/usage/v8/datetime/styling/calendar-header/vue.md b/static/usage/v8/datetime/styling/calendar-header/vue.md index 16b7da10a4..7dfd0f42ac 100644 --- a/static/usage/v8/datetime/styling/calendar-header/vue.md +++ b/static/usage/v8/datetime/styling/calendar-header/vue.md @@ -12,8 +12,29 @@ * Custom Datetime Calendar Header Part * ------------------------------------------- */ + ion-datetime::part(calendar-header) { + background-color: orange; + } + ion-datetime::part(month-year-button) { background-color: lightblue; } + + ion-datetime::part(prev-next-buttons) { + background-color: firebrick; + } + + ion-datetime::part(prev-button) { + color: white; + } + + ion-datetime::part(next-button) { + color: black; + } + + ion-datetime::part(days-of-week) { + background-color: #9ad162; + color: white; + } ``` From c22dadb8b0c675cf847045041bb1456dd61be110 Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Fri, 6 Feb 2026 13:57:18 -0800 Subject: [PATCH 2/4] feat(datetime): add datetime part --- docs/api/datetime.md | 11 ++++++ .../angular/example_component_css.md | 9 +++++ .../angular/example_component_html.md | 5 +++ .../angular/example_component_ts.md | 12 +++++++ .../styling/datetime-header/demo.html | 35 +++++++++++++++++++ .../datetime/styling/datetime-header/index.md | 35 +++++++++++++++++++ .../styling/datetime-header/javascript.md | 15 ++++++++ .../styling/datetime-header/react/main_css.md | 9 +++++ .../styling/datetime-header/react/main_tsx.md | 17 +++++++++ .../datetime/styling/datetime-header/vue.md | 22 ++++++++++++ 10 files changed, 170 insertions(+) create mode 100644 static/usage/v8/datetime/styling/datetime-header/angular/example_component_css.md create mode 100644 static/usage/v8/datetime/styling/datetime-header/angular/example_component_html.md create mode 100644 static/usage/v8/datetime/styling/datetime-header/angular/example_component_ts.md create mode 100644 static/usage/v8/datetime/styling/datetime-header/demo.html create mode 100644 static/usage/v8/datetime/styling/datetime-header/index.md create mode 100644 static/usage/v8/datetime/styling/datetime-header/javascript.md create mode 100644 static/usage/v8/datetime/styling/datetime-header/react/main_css.md create mode 100644 static/usage/v8/datetime/styling/datetime-header/react/main_tsx.md create mode 100644 static/usage/v8/datetime/styling/datetime-header/vue.md diff --git a/docs/api/datetime.md b/docs/api/datetime.md index 252d8c8d94..ff7a5a95da 100644 --- a/docs/api/datetime.md +++ b/docs/api/datetime.md @@ -43,6 +43,7 @@ import MultipleDateSelection from '@site/static/usage/v8/datetime/multiple/index import GlobalTheming from '@site/static/usage/v8/datetime/styling/global-theming/index.md'; import CalendarHeaderStyling from '@site/static/usage/v8/datetime/styling/calendar-header/index.md'; import CalendarDaysStyling from '@site/static/usage/v8/datetime/styling/calendar-days/index.md'; +import DatetimeHeaderStyling from '@site/static/usage/v8/datetime/styling/datetime-header/index.md'; import WheelStyling from '@site/static/usage/v8/datetime/styling/wheel-styling/index.md'; @@ -371,6 +372,16 @@ The example below selects the day 2 days ago, unless that day is in the previous +### Datetime Header + +The datetime header manages the content for the `title` slot and the selected date. + +:::note +The selected date will not render if `preferWheel` is set to `true`. +::: + + + ### Wheel Pickers The wheels used in `ion-datetime` can be styled through a combination of shadow parts and CSS variables. This applies to both the columns in wheel-style datetimes, and the month/year picker in grid-style datetimes. diff --git a/static/usage/v8/datetime/styling/datetime-header/angular/example_component_css.md b/static/usage/v8/datetime/styling/datetime-header/angular/example_component_css.md new file mode 100644 index 0000000000..93733de0a9 --- /dev/null +++ b/static/usage/v8/datetime/styling/datetime-header/angular/example_component_css.md @@ -0,0 +1,9 @@ +```css +/* + * Custom Datetime Header Part + * ------------------------------------------- + */ +ion-datetime::part(datetime-header) { + background-color: orange; +} +``` diff --git a/static/usage/v8/datetime/styling/datetime-header/angular/example_component_html.md b/static/usage/v8/datetime/styling/datetime-header/angular/example_component_html.md new file mode 100644 index 0000000000..64b144ee4e --- /dev/null +++ b/static/usage/v8/datetime/styling/datetime-header/angular/example_component_html.md @@ -0,0 +1,5 @@ +```html + + Select Date + +``` diff --git a/static/usage/v8/datetime/styling/datetime-header/angular/example_component_ts.md b/static/usage/v8/datetime/styling/datetime-header/angular/example_component_ts.md new file mode 100644 index 0000000000..75ed761f6e --- /dev/null +++ b/static/usage/v8/datetime/styling/datetime-header/angular/example_component_ts.md @@ -0,0 +1,12 @@ +```ts +import { Component } from '@angular/core'; +import { IonDatetime } from '@ionic/angular/standalone'; + +@Component({ + selector: 'app-example', + templateUrl: 'example.component.html', + styleUrls: ['./example.component.css'], + imports: [IonDatetime], +}) +export class ExampleComponent {} +``` diff --git a/static/usage/v8/datetime/styling/datetime-header/demo.html b/static/usage/v8/datetime/styling/datetime-header/demo.html new file mode 100644 index 0000000000..5f54a160ae --- /dev/null +++ b/static/usage/v8/datetime/styling/datetime-header/demo.html @@ -0,0 +1,35 @@ + + + + + + Datetime + + + + + + + + + + + +
+ + Select Date + +
+
+
+ + diff --git a/static/usage/v8/datetime/styling/datetime-header/index.md b/static/usage/v8/datetime/styling/datetime-header/index.md new file mode 100644 index 0000000000..db105f3fe6 --- /dev/null +++ b/static/usage/v8/datetime/styling/datetime-header/index.md @@ -0,0 +1,35 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; + +import react_main_tsx from './react/main_tsx.md'; +import react_main_css from './react/main_css.md'; + +import vue from './vue.md'; + +import angular_example_component_html from './angular/example_component_html.md'; +import angular_example_component_css from './angular/example_component_css.md'; +import angular_example_component_ts from './angular/example_component_ts.md'; + + diff --git a/static/usage/v8/datetime/styling/datetime-header/javascript.md b/static/usage/v8/datetime/styling/datetime-header/javascript.md new file mode 100644 index 0000000000..4326b12444 --- /dev/null +++ b/static/usage/v8/datetime/styling/datetime-header/javascript.md @@ -0,0 +1,15 @@ +```html + + Select Date + + + +``` diff --git a/static/usage/v8/datetime/styling/datetime-header/react/main_css.md b/static/usage/v8/datetime/styling/datetime-header/react/main_css.md new file mode 100644 index 0000000000..93733de0a9 --- /dev/null +++ b/static/usage/v8/datetime/styling/datetime-header/react/main_css.md @@ -0,0 +1,9 @@ +```css +/* + * Custom Datetime Header Part + * ------------------------------------------- + */ +ion-datetime::part(datetime-header) { + background-color: orange; +} +``` diff --git a/static/usage/v8/datetime/styling/datetime-header/react/main_tsx.md b/static/usage/v8/datetime/styling/datetime-header/react/main_tsx.md new file mode 100644 index 0000000000..b1cf208846 --- /dev/null +++ b/static/usage/v8/datetime/styling/datetime-header/react/main_tsx.md @@ -0,0 +1,17 @@ +```tsx +import React from 'react'; +import { IonDatetime } from '@ionic/react'; + +import './main.css'; + +function Example() { + return ( + <> + + Select Date + + + ); +} +export default Example; +``` diff --git a/static/usage/v8/datetime/styling/datetime-header/vue.md b/static/usage/v8/datetime/styling/datetime-header/vue.md new file mode 100644 index 0000000000..6c5e5d6b40 --- /dev/null +++ b/static/usage/v8/datetime/styling/datetime-header/vue.md @@ -0,0 +1,22 @@ +```html + + + + + +``` From 99f8056de6e8781cb9f8c1625e324446850f3dda Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Tue, 17 Feb 2026 14:42:32 -0800 Subject: [PATCH 3/4] docs(datetime): move datetime header above calendar header --- docs/api/datetime.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/api/datetime.md b/docs/api/datetime.md index ff7a5a95da..9ba9253dd4 100644 --- a/docs/api/datetime.md +++ b/docs/api/datetime.md @@ -354,6 +354,16 @@ The benefit of this approach is that every component, not just `ion-datetime`, c +### Datetime Header + +The datetime header manages the content for the `title` slot and the selected date. + +:::note +The selected date will not render if `preferWheel` is set to `true`. +::: + + + ### Calender Header The calendar header manages the date navigation controls (month/year picker and prev/next buttons) and the days of the week when using a grid style layout. @@ -372,16 +382,6 @@ The example below selects the day 2 days ago, unless that day is in the previous -### Datetime Header - -The datetime header manages the content for the `title` slot and the selected date. - -:::note -The selected date will not render if `preferWheel` is set to `true`. -::: - - - ### Wheel Pickers The wheels used in `ion-datetime` can be styled through a combination of shadow parts and CSS variables. This applies to both the columns in wheel-style datetimes, and the month/year picker in grid-style datetimes. From 9988ddd11d691f8dacf6b153656297a9bc37a9ed Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Wed, 18 Feb 2026 14:10:14 -0800 Subject: [PATCH 4/4] docs(datetime): update part names --- .../calendar-header/angular/example_component_css.md | 6 +++--- .../v8/datetime/styling/calendar-header/demo.html | 6 +++--- .../v8/datetime/styling/calendar-header/javascript.md | 6 +++--- .../datetime/styling/calendar-header/react/main_css.md | 6 +++--- .../usage/v8/datetime/styling/calendar-header/vue.md | 6 +++--- .../datetime-header/angular/example_component_css.md | 10 +++++++++- .../v8/datetime/styling/datetime-header/demo.html | 10 +++++++++- .../v8/datetime/styling/datetime-header/javascript.md | 10 +++++++++- .../datetime/styling/datetime-header/react/main_css.md | 10 +++++++++- .../usage/v8/datetime/styling/datetime-header/vue.md | 10 +++++++++- 10 files changed, 60 insertions(+), 20 deletions(-) diff --git a/static/usage/v8/datetime/styling/calendar-header/angular/example_component_css.md b/static/usage/v8/datetime/styling/calendar-header/angular/example_component_css.md index ab447447cb..f3ebd71533 100644 --- a/static/usage/v8/datetime/styling/calendar-header/angular/example_component_css.md +++ b/static/usage/v8/datetime/styling/calendar-header/angular/example_component_css.md @@ -11,11 +11,11 @@ ion-datetime::part(month-year-button) { background-color: lightblue; } -ion-datetime::part(prev-next-buttons) { +ion-datetime::part(navigation-button) { background-color: firebrick; } -ion-datetime::part(prev-button) { +ion-datetime::part(previous-button) { color: white; } @@ -23,7 +23,7 @@ ion-datetime::part(next-button) { color: black; } -ion-datetime::part(days-of-week) { +ion-datetime::part(calendar-days-of-week) { background-color: #9ad162; color: white; } diff --git a/static/usage/v8/datetime/styling/calendar-header/demo.html b/static/usage/v8/datetime/styling/calendar-header/demo.html index 96c4861828..5dfef5ca9b 100644 --- a/static/usage/v8/datetime/styling/calendar-header/demo.html +++ b/static/usage/v8/datetime/styling/calendar-header/demo.html @@ -23,11 +23,11 @@ background-color: lightblue; } - ion-datetime::part(prev-next-buttons) { + ion-datetime::part(navigation-button) { background-color: firebrick; } - ion-datetime::part(prev-button) { + ion-datetime::part(previous-button) { color: white; } @@ -35,7 +35,7 @@ color: black; } - ion-datetime::part(days-of-week) { + ion-datetime::part(calendar-days-of-week) { background-color: #9ad162; color: white; } diff --git a/static/usage/v8/datetime/styling/calendar-header/javascript.md b/static/usage/v8/datetime/styling/calendar-header/javascript.md index 4bd155c4f8..84ed00226c 100644 --- a/static/usage/v8/datetime/styling/calendar-header/javascript.md +++ b/static/usage/v8/datetime/styling/calendar-header/javascript.md @@ -14,11 +14,11 @@ background-color: lightblue; } - ion-datetime::part(prev-next-buttons) { + ion-datetime::part(navigation-button) { background-color: firebrick; } - ion-datetime::part(prev-button) { + ion-datetime::part(previous-button) { color: white; } @@ -26,7 +26,7 @@ color: black; } - ion-datetime::part(days-of-week) { + ion-datetime::part(calendar-days-of-week) { background-color: #9ad162; color: white; } diff --git a/static/usage/v8/datetime/styling/calendar-header/react/main_css.md b/static/usage/v8/datetime/styling/calendar-header/react/main_css.md index ab447447cb..f3ebd71533 100644 --- a/static/usage/v8/datetime/styling/calendar-header/react/main_css.md +++ b/static/usage/v8/datetime/styling/calendar-header/react/main_css.md @@ -11,11 +11,11 @@ ion-datetime::part(month-year-button) { background-color: lightblue; } -ion-datetime::part(prev-next-buttons) { +ion-datetime::part(navigation-button) { background-color: firebrick; } -ion-datetime::part(prev-button) { +ion-datetime::part(previous-button) { color: white; } @@ -23,7 +23,7 @@ ion-datetime::part(next-button) { color: black; } -ion-datetime::part(days-of-week) { +ion-datetime::part(calendar-days-of-week) { background-color: #9ad162; color: white; } diff --git a/static/usage/v8/datetime/styling/calendar-header/vue.md b/static/usage/v8/datetime/styling/calendar-header/vue.md index 7dfd0f42ac..72d57d7739 100644 --- a/static/usage/v8/datetime/styling/calendar-header/vue.md +++ b/static/usage/v8/datetime/styling/calendar-header/vue.md @@ -20,11 +20,11 @@ background-color: lightblue; } - ion-datetime::part(prev-next-buttons) { + ion-datetime::part(navigation-button) { background-color: firebrick; } - ion-datetime::part(prev-button) { + ion-datetime::part(previous-button) { color: white; } @@ -32,7 +32,7 @@ color: black; } - ion-datetime::part(days-of-week) { + ion-datetime::part(calendar-days-of-week) { background-color: #9ad162; color: white; } diff --git a/static/usage/v8/datetime/styling/datetime-header/angular/example_component_css.md b/static/usage/v8/datetime/styling/datetime-header/angular/example_component_css.md index 93733de0a9..d8e9e9e634 100644 --- a/static/usage/v8/datetime/styling/datetime-header/angular/example_component_css.md +++ b/static/usage/v8/datetime/styling/datetime-header/angular/example_component_css.md @@ -1,9 +1,17 @@ ```css /* - * Custom Datetime Header Part + * Custom Datetime Header Parts * ------------------------------------------- */ ion-datetime::part(datetime-header) { background-color: orange; } + +ion-datetime::part(datetime-title) { + background-color: pink; +} + +ion-datetime::part(datetime-selected-date) { + background-color: violet; +} ``` diff --git a/static/usage/v8/datetime/styling/datetime-header/demo.html b/static/usage/v8/datetime/styling/datetime-header/demo.html index 5f54a160ae..45155774ed 100644 --- a/static/usage/v8/datetime/styling/datetime-header/demo.html +++ b/static/usage/v8/datetime/styling/datetime-header/demo.html @@ -11,13 +11,21 @@ diff --git a/static/usage/v8/datetime/styling/datetime-header/javascript.md b/static/usage/v8/datetime/styling/datetime-header/javascript.md index 4326b12444..ebd98aff22 100644 --- a/static/usage/v8/datetime/styling/datetime-header/javascript.md +++ b/static/usage/v8/datetime/styling/datetime-header/javascript.md @@ -5,11 +5,19 @@ ``` diff --git a/static/usage/v8/datetime/styling/datetime-header/react/main_css.md b/static/usage/v8/datetime/styling/datetime-header/react/main_css.md index 93733de0a9..d8e9e9e634 100644 --- a/static/usage/v8/datetime/styling/datetime-header/react/main_css.md +++ b/static/usage/v8/datetime/styling/datetime-header/react/main_css.md @@ -1,9 +1,17 @@ ```css /* - * Custom Datetime Header Part + * Custom Datetime Header Parts * ------------------------------------------- */ ion-datetime::part(datetime-header) { background-color: orange; } + +ion-datetime::part(datetime-title) { + background-color: pink; +} + +ion-datetime::part(datetime-selected-date) { + background-color: violet; +} ``` diff --git a/static/usage/v8/datetime/styling/datetime-header/vue.md b/static/usage/v8/datetime/styling/datetime-header/vue.md index 6c5e5d6b40..f837edba6e 100644 --- a/static/usage/v8/datetime/styling/datetime-header/vue.md +++ b/static/usage/v8/datetime/styling/datetime-header/vue.md @@ -11,12 +11,20 @@ ```