Date Picker for Ionic

Thanks for your response,

<ionic-datepicker input-obj="datepickerObject">
  <button class="button button-block button-positive"> {{datepickerObject.inputDate | date:'dd - MMMM - yyyy'}}</button>
</ionic-datepicker>

That above code shows the current date…but i want to show my localstorage date on it…for example i get the date form localstorage and use this code {{infoRem.at}} to view in datepicker.

please help me to find out the actual solution.

You have to get the date from LocalStorage, when you enter into the page where you are using this component. As the page will have a separate controller, on entering into that controller you can get it from LocalStorage and in the same controller you might be using the object which is needed for this component. To that object you can assign the date which you have already got from the LocalStorage.

Thank You… It’s works fine but i got one small issue… when i changed the date it’s shows the same date in ionic-datepicker

You have to assign the date to $scope.datepickerObject.inputDate, which you will receive in the callback. Then it will also update the date on the button where you are using it. If you wish to continue this discussion on ionic-datepicker component, you can continue here. That will also help people who are using this component.

Thank You @rajeshwarpatlolla !.. It’s works fine… :relaxed:

hi @rajeshwarpatlolla the date in the button still not changing when i set a date. please help

You need to assign the date to a scope variable in the controller. This is the variable, which you need use to show the date on the button.

it’s so simple just use input type= date it will give 100% effect of the date picker.
and in angular you can use max and min date validation also.

I could not make your plugin work for me.
I always have the error: ionicDatePickerProvider does not exist

After injecting in the main module and trying to configure in the .config(…) method.

I just gave up on using it, after several tries I could not find out what’s wrong.

Please follow the exact steps mentioned in the documentation. You should get it for sure. Also cross check whether you installed the component and injected the module properly.