Skip to content

bug: ion-datetime-button does not respect minuteValues and others #30183

Description

@Ionaru

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

A ion-datetime-button element will default to an unselectable date or time when these properties are used on the ion-datetime element:

  • monthValues
  • dayValues
  • yearValues
  • hourValues
  • minuteValues

Image

Image

Expected Behavior

The ion-datetime-button contents should default to show the closest available valid value. Like the example for ion-datetime does.

Image

Steps to Reproduce

  1. Use this template code
<ion-modal [keepContentsMounted]="true">
  <ng-template>
    <ion-datetime id="datetime" minuteValues="0" />
  </ng-template>
</ion-modal>
  1. See the button show any date or time outside the values allowed by minuteValues (or the other properties)

Code Reproduction URL

https://stackblitz.com/edit/sgkfctaz?file=src%2Fapp%2Fexample.component.html

Ionic Info

Ionic:

   Ionic CLI                     : 7.2.0 (C:\Users\<NAME>\AppData\Local\nvs\node\22.12.0\x64\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 8.4.2 (C:\Users\<NAME>\Projects\<PROJECT>\node_modules\@ionic\angular)
   @angular-devkit/build-angular : 19.1.4 (C:\Users\<NAME>\Projects\<PROJECT>\node_modules\@angular-devkit\build-angular)
   @angular-devkit/schematics    : 19.1.4 (C:\Users\<NAME>\Projects\<PROJECT>\node_modules\@angular-devkit\schematics)
   @angular/cli                  : 19.1.4 (C:\Users\<NAME>\Projects\<PROJECT>\node_modules\@angular\cli)
   @ionic/angular-toolkit        : 12.1.1 (C:\Users\<NAME>\Projects\<PROJECT>\node_modules\@ionic\angular-toolkit)

Capacitor:

   Capacitor CLI      : not installed
   @capacitor/android : 6.2.0 (C:\Users\<NAME>\Projects\<PROJECT>\node_modules\@capacitor\android)
   @capacitor/core    : 6.2.0 (C:\Users\<NAME>\Projects\<PROJECT>\node_modules\@capacitor\core)
   @capacitor/ios     : 6.2.0 (C:\Users\<NAME>\Projects\<PROJECT>\node_modules\@capacitor\ios)

Utility:

   cordova-res : not installed globally
   native-run  : not installed globally

System:

   NodeJS : v22.12.0 (C:\Users\<NAME>\AppData\Local\nvs\default\node.exe)
   npm    : 11.1.0
   OS     : Windows 10

Additional Information

Possibly related to #24722

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions