Ionic 4: DateTime - Start picker on today's date
See original GitHub issueFeature Request
Ionic Info
Run ionic info
from a terminal/cmd prompt and paste the output below.
Ionic:
ionic (Ionic CLI) : 4.3.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.15
@angular-devkit/build-angular : 0.9.0-beta.3
@angular-devkit/schematics : 0.9.0-beta.3
@angular/cli : 6.1.5
@ionic/angular-toolkit : not installed
Cordova:
cordova (Cordova CLI) : 7.1.0
Cordova Platforms : browser 5.0.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 9 other plugins)
System:
ios-deploy : 1.9.1
NodeJS : v10.10.0 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS High Sierra
Describe the Bug In DateTime when a ‘max’ is set, the date picker starts at at max value, which makes it a poor UI experience. It should start at current date/time or property to supply a starting point.
Steps to Reproduce In Ionic 4 set Datetime ‘max’ to a large number and picker will start their.
Expected Behavior Start at today’s date or allow us to supply a starting pointl
Additional Context
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:27 (11 by maintainers)
Top Results From Across the Web
ion-datetime - Ionic Framework
Datetimes present a picker interface to select dates and times. Ionic's API Datetime input component easily displays a preferred format, and manages values....
Read more >How do I set my ion-datetime to today's date automatically ...
I want my date and time to automatically display the current date and time without needing to click the picker first.
Read more >Ionic 4 Datetime Tutorial - YouTube
Allow your users to pick a date and or a time with the ionic datetime ( ion - datetime ) in Ionic 4....
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...
Read more >The New Datetime Component In Ionic - Ionic Blog
Get the backstory on the changes to the new Ionic Datetime component and how you can upgrade to use the new verion today....
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 Free
Top 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
@liamdebeasi Thanks Liam upgraded and looks like it is defaulting to today’s time. However it seems like it defaults to GMT time not the local time. Another person has already raised an issue:
https://github.com/ionic-team/ionic/issues/17587
I was trying to avoid dirtying the form. I can do a work around by having a viewValue and my dataValue. The viewValue is what the date time uses whilst the dataValue updates if the OK button is pressed which now can be controlled though the custom picker options.
However it’s seems a bit of work for something that logically should be available. If you look at angular material date picker which is a good comparison given it’s maturity and popularity, they have a whole section dedicated to setting the initial view.
https://material.angular.io/components/datepicker/overview