Skip to content

bug: datetime locale with h23 does not respect max range #24588

@OlivierChirouze

Description

@OlivierChirouze

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

I set min and max values for date-time.

  • min value is 18:30
  • max value is 20:40
  • initial value is set to 20:30

I carefully provide values that don't include any timezone, to keep things simple. It works fine for min and initial value. It doesn't for max.
Max value seems to be exactly 3 hours later than the provided value (one can set anything up to 23:40). Users should be prevented from setting anything above 20:40.

Example:
https://stackblitz.com/edit/angular-ivy-cyzzpl?file=src/app/app.component.ts

As far as I remember, this used to work fine on Ionic 5 (but I had to adapt the code for the new date format anyway).

Expected Behavior

The min value should be exactly the one provided and users should not be able to pass it.

Steps to Reproduce

Set a max value and try to define a value that goes beyond this max value.

Code Reproduction URL

https://stackblitz.com/edit/angular-ivy-cyzzpl?file=src/app/app.component.ts

Ionic Info

Ionic:

Ionic CLI : 6.18.1 (/Users/o.chirouze/.nvm/versions/node/v14.18.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.0.2
@angular-devkit/build-angular : 12.2.14
@angular-devkit/schematics : 12.2.14
@angular/cli : 12.2.14
@ionic/angular-toolkit : 4.0.0

Capacitor:

Capacitor CLI : 3.3.2
@capacitor/android : 3.3.2
@capacitor/core : 3.3.2
@capacitor/ios : 3.3.2

Cordova:

Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : not available

Utility:

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

System:

NodeJS : v14.18.2 (/Users/o.chirouze/.nvm/versions/node/v14.18.2/bin/node)
npm : 6.14.15
OS : macOS Monterey

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions