diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx
index 2ae9db4565..4e9d22a500 100644
--- a/core/src/components/datetime/datetime.tsx
+++ b/core/src/components/datetime/datetime.tsx
@@ -273,6 +273,11 @@ export class Datetime implements ComponentInterface {
this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues);
}
+ @Watch('activeParts')
+ protected activePartsChanged() {
+ this.activePartsClone = this.activeParts;
+ }
+
/**
* The locale to use for `ion-datetime`. This
* impacts month and day name formatting.
@@ -802,14 +807,14 @@ export class Datetime implements ComponentInterface {
startIO = new IntersectionObserver(ev => ioCallback('start', ev), {
threshold: mode === 'ios' ? [0.7, 1] : 1,
root: calendarBodyRef
- });
+ });
startIO.observe(startMonth);
this.destroyCalendarIO = () => {
endIO?.disconnect();
startIO?.disconnect();
}
- });
+ });
}
connectedCallback() {
@@ -944,7 +949,7 @@ export class Datetime implements ComponentInterface {
ampm: hour >= 12 ? 'pm' : 'am'
}
- this.activePartsClone = this.activeParts = {
+ this.activeParts = {
month,
day,
year,
@@ -1206,7 +1211,7 @@ export class Datetime implements ComponentInterface {
month,
day,
year
- })
+ });
}}
>{day}
)
@@ -1249,7 +1254,7 @@ export class Datetime implements ComponentInterface {
minutesItems: PickerColumnItem[],
ampmItems: PickerColumnItem[],
use24Hour: boolean
- ) {
+ ) {
const { color, activePartsClone, workingParts } = this;
return (
@@ -1290,7 +1295,7 @@ export class Datetime implements ComponentInterface {
ev.stopPropagation();
}}
>
- { !use24Hour &&