question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: datetime should not report the timezone in ionChange

See original GitHub issue

Prerequisites

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:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Oct 31, 2022

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.

0reactions
ionitron-bot[bot]commented, Nov 30, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found