Feature Request : DateTime Component - Option to set current time as default value for picker
See original GitHub issueShort description of the problem:
The DateTime Component allows to create a simple input component for date and time inputs. It would be nice, if there was an option to set the current time as default value for the picker.
In many cases it would be useful, if the default value of the picker was not 1. January 2016 but the current date of the day. With this people could fill out the form even faster, same applies to time inputs.
What behavior are you expecting?
Add some sort of attribute to the datetime component which allows to set the default value of the picker to the current time.
<ion-item>
<ion-label>Date</ion-label>
<ion-datetime displayFormat="MM/DD/YYYY" [(ngModel)]="myDate" useCurrentTimeAsDefaultValue="true"></ion-datetime>
</ion-item>
Which Ionic Version? ionic 2.00-beta 11
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
DateTime Component - Option to set current time as default ...
Short description of the problem: The DateTime Component allows to create a simple input component for date and time inputs.
Read more >Solved: How to set current date as default date in date pi...
Another alternative, which is probably preferred, is to "Reset" the date picker control - which causes its selected date to go back to...
Read more >Can I dynamically set default value to date picker?
Hello,. After creating a date-picker, there is an option to set the "Default Value" for it. And this is a static value.
Read more >Default value for DateTime Picker - Inductive Automation Forum
Right-click your DateTime component. Select “Configure Events”. Select the onStartup option under System Events. Select a Script Action.
Read more ><input type="datetime-local"> - HTML - MDN Web Docs
elements of type datetime-local create input controls that let ... You can set a default value for the input by including a date...
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
What if we want our input to be empty but setting picker to the current date ?
+1 on @charlesen’s comment. This is a situation I’m currently facing which doesn’t seem to be catered for…