Skip to content

bug: Incorrect time displayed after selection in Datetime #25693

Closed
@pvo13

Description

@pvo13

Prerequisites

Ionic Framework Version

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

Current Behavior

I use an ion-datetime component to select a date and time.

When I click on the current time to change it, scroll wheels appear and I can change the hour. If I do that, the selected value is being propagated back to the underlying component and displayed, but not the value I have chosen, but a different one. This offset in my case is two, it seems to depend on the browsers timezone. So I choose 22 and the within the component the hour part shows 20
ion-datetime_bug

Expected Behavior

I expect the time that I select to be exactly to be the time I then see in the component.

Steps to Reproduce

Open the ion-datetime description page and use one oft he examples that contain the time part, e.g. https://ionicframework.com/docs/api/datetime#showing-the-default-title

When I click on the current time to change it, scroll wheels appear and I can change the hour. If I do that, the selected value is being propagated back to the underlying component and displayed, but not the value I have chosen, but another one with an offset. The offset in my case is two, it seems to depend on the browsers timezone.

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.18.1 (/usr/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.2.0
@angular-devkit/build-angular : 14.1.0
@angular-devkit/schematics : 14.1.0
@angular/cli : 14.1.0
@ionic/angular-toolkit : 7.0.0

Utility:

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

System:

NodeJS : v16.16.0 (/usr/bin/node)
npm : 8.11.0
OS : Linux 5.4

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions