katemihalikova / ion-datetime-picker

Date and/or time picker for awesome Ionic framework
MIT License
169 stars 101 forks source link

Reset to default values #64

Closed incansoft closed 7 years ago

incansoft commented 7 years ago

hi, first thank you for the component, I have a question, I'm starting with ionic/angular and I'm trying to set the initial date and time, so far I can do it using the ng-model variable name and then from my controller I do something like...

$scope.datetimeValue = "2017-01-01";

that actually update the label but once I click the label to open the popup dialog, the date is not updated and still shows today.

Also once I select a date from the control and the span is updated with the selected date, I don't know how to reset the date, the case is, the user is adding a new task with date and time, after the user save the task I;m looking to clean the form and reset the datetime picker to today's date.

Thanks for your time.

Diego

katemihalikova commented 7 years ago

Hi Diego, your first issue seems to be a duplicate of #19 and #14, also please note that the picker is using Date instances as a model, nothing else. Your second question is easy, just use assignment again to overwrite the value, i.e. $scope.datetimeValue = new Date();.

incansoft commented 7 years ago

Thanks for your replied I'm going to read those threads.

El sept. 18, 2016 11:33 PM, "Kate Miháliková" notifications@github.com escribió:

Hi Diego, your first issue seems to be a duplicate of #19 https://github.com/katemihalikova/ion-datetime-picker/issues/19 and #14 https://github.com/katemihalikova/ion-datetime-picker/issues/14, also please note that the picker is using Date instances as a model, nothing else. Your second question is easy, just use assignment again to overwrite the value, i.e. $scope.datetimeValue = new Date();.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/katemihalikova/ion-datetime-picker/issues/64#issuecomment-247909971, or mute the thread https://github.com/notifications/unsubscribe-auth/ARQz377DfRWw1f7g0BGhHHiPu7UkVumsks5qrhCAgaJpZM4KAIIj .