bug: datetime should not report the timezone in ionChange
See original GitHub issuePrerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
- Nightly
Current Behavior
Documentation explain that ion-datetime dont take care about timezone.
However itβs not totaly trueβ¦
If we initialize the ion-datetime value with an UTC datetime:
2022-07-06T03:16:00Z
The picker properly show the expected time without trying to convert it to local timezone (as expected) (in other word: time is 03:16).
However, when we click on done, the datime picker add a timezone information to the current value:
2022-07-06T03:16:00+02:00
Expected Behavior
The picker should not change TZ as it is not supposed to manage the timezone.
If we try to display the picker date into an ion-input using Angular date pipe, then the value changeβ¦
Steps to Reproduce
<ion-item>
<ion-label>Start</ion-label>
<ion-input #startPicker id="pickerStartTime" value="{{ pickerStartTime | date 'long' }}"></ion-input>
<ion-popover trigger="pickerStartTime" class="popover-datetime">
<ng-template>
<ion-datetime [(ngModel)]="pickerStartTime" name="pickerStartTime" presentation="date-time" [showDefaultButtons]="true">
<span slot="title">Select a start time</span>
</ion-datetime>
</ng-template>
</ion-popover>
</ion-item>
Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 6.17.1 (/home/joran/.nvm/versions/node/v14.17.3/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.1.12
@angular-devkit/build-angular : 14.0.4
@angular-devkit/schematics : 14.0.4
@angular/cli : 14.0.4
@ionic/angular-toolkit : 6.1.0
Capacitor:
Capacitor CLI : 3.6.0
@capacitor/android : 3.6.0
@capacitor/core : 3.6.0
@capacitor/ios : 3.6.0
Cordova:
Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : not installed globally
native-run : 1.6.0
System:
NodeJS : v14.17.3 (/home/joran/.nvm/versions/node/v14.17.3/bin/node)
npm : 7.24.2
OS : Linux 5.15
βββββββββββββββββββββββββββββββββββββββββββββββββ
Ionic CLI update available: 6.17.1 β 6.20.1
Run npm i -g @ionic/cli to update
βββββββββββββββββββββββββββββββββββββββββββββββββ
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Ionic 5 (Angular) can't set <ion-datetime> time - Stack Overflow
No errors, FormsModule imported. Further tests show me the date gets actually set, but not the hour. Do you think I should fill...
Read more >lightning-input type date time picks incorrect time value
The date and time displayed reflect your Salesforce time zone setting. Use the timezone attribute to specify a different time zone in IANAΒ ......
Read more >Specify Time Zones - MATLAB & Simulink - MathWorks
When you create a datetime, it is unzoned by default. That is, the TimeZone property of the datetime is empty ( '' )....
Read more >react-datetime - npm
A date and time picker in the same React.js component. It can be used as a datepicker, timepicker or both at the same...
Read more ><input type="datetime-local"> - HTML - MDN Web Docs
The control is intended to represent a local date and time, not ... the user to enter a time zone along with a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic-framework/pull/26183, and a fix will be available in an upcoming major release of Ionic Framework. Please feel free to continue testing the dev build, and let me know if you run into any issues.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.