ion-datetime default value is not local
See original GitHub issueBug Report
Ionic version:
[x] 4.0.2
Current behavior: ion-datetime currently defaults to todays date if none is selected but does not give an option to apply an offset. Because of this, the time is not local.
Expected behavior:
ion-datetime default value should be local.
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.2
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.3.1
@angular/cli : 7.3.1
@ionic/angular-toolkit : 1.3.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.5, (and 14 other plugins)
System:
ios-deploy : 2.0.0
NodeJS : v10.15.0 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:13 (6 by maintainers)
Top Results From Across the Web
ion-datetime default value is not local · Issue #17587 - GitHub
Current behavior: ion-datetime currently defaults to todays date if none is selected but does not give an option to apply an offset. Because...
Read more >Ionic ion-datetime: how to set default picker value
You using momentJs which already by default use hte local time so there is no need to subtract the offset.
Read more >ion-datetime - Ionic Framework
Ionic's ion-datetime follows the datetime-local behavior of not manipulating or setting the time zone inside of a datetime control. In other words, a...
Read more >Ionic 6 ion-datetime | Complete guide - YouTube
Hello Friends, Welcome Back to @CodingTechnyks. In this video, we are going to work with Ionic 6 ion - datetime using #ionic #angular...
Read more >Date picker popup in Ionic 6 | Damir's Corner
Fortunately, there are not too many breaking changes in Ionic 6. The one that impacted the applications that I had to update to...
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
@liamdebeasi updating the dev for @ionic/angular helped.
Here is my steps:
It showed the correct current time with the above sample code. Thank you!
Beat me to it, yes same issue the default time is not local it seems like it is defaulting to the GMT time.