Hi all I’m new for Ionic 2, I’m trying to use the Date Picker in my ionic 2 app, i have tried many ways but all are not useful to us, so please any one knows the ideas to do the ionic 2 date picker please help to us,
we have tried ion-datetime but we expecting to do like mentioned image of datepicker in my app…we have tried many ways but all are not useful so can you provide the suggestion and solution, thanks, and i have asked question in stackoverflow this the link:- http://stackoverflow.com/questions/41610110/dynamic-datepicker-with-repeat-option-similar-to-alarm so please check update the plunker as well to know the solution…
Hi, I just test your Plugin and it’s incredible, congratulations! It works on Android devices very well, but on IOS device, is not working, the calendar doesn’t show. Can you give me a tip to fix this issue. I’m testing on iPhone 4 with OS 9.3.3
Hey, sorry for delay, but the answer is yes. It works well with ionic-3 both for android and iOS. If you need any code help then reply back for the same.
Thanks
Hey I was waiting for your reply, I want to make visible all days for previous days and month. I have used ion-2 component option in which I can select day from today only.
Hey, if you want to provide a defined date range in which the user can select the range of dates, then you should do something like this:
//for new range based datepicker
openCalendar() {
let fromDate: any = new Date("1/01/2017"); //default starting date for calendar
let toDate: any = new Date(new Date().setDate(new Date().getDate() - 1)).setHours(0, 0, 0, 0)
toDate = new Date(toDate);
const options: CalendarModalOptions = {
pickMode: 'range',
title: 'Select Date Range',
closeIcon: true,
doneIcon: true,
from: fromDate,
to: toDate,
defaultScrollTo: toDate,
};
let myCalendar = this.modalCtrl.create(CalendarModal, {
options: options
});
myCalendar.present();
myCalendar.onDidDismiss((date: { from: CalendarResult; to: CalendarResult }, type: string) => {
//.....do what you want to do on dismissing the calendar modal :)
});
}
So, if you want to set the start date as 1 Jan 2018, simply set the fromDate as "1/01/2018", and do the same for toDate.
I hope this helps
Hey,
You only need to set true or false for doneIcon and closeIcon as they are boolean properties, and for defaultScrollTo, set a particular date for it like today's date
I am also using ionic-3 and it is working fine for me both on Android and iOS, what problem are you facing exactly? Please comment your console errors, so that I can reference.
I am getting issue like instead of ionic-angular package the plugin is importing @ionic/angular issue. This is the issue ionic is throwing. Please share a possible solution.