Ionic 2 Datepicker

Ionic 1 has support to the native date picker but why Ionic 2 remove this?

It’s not been removed. It’s just not been added yet (this is still in beta). See the roadmap:

2 Likes

thanks :slightly_smiling:

I’m slightly confused (and new to ionic).

When we check out ionic@beta with npm, we get beta.17, but on github it’s only up to beta.1, while the missing date picker is slated for beta.5…
What am I missing?

So this is a bit of naming conflicts (see here)

Basically ionic on npm is the CLI
ionic-framework on npm is the framework package

2 Likes

Anyone tried it? It is in ionic-native, but it seems not to react properly. In fact, it does not show up at all.

Also, in VS Code, I always get warning saying that my arguments are not right.

When putting what is written in the doc:

image

I tried with 'new Date().toDateString(), but similar warnings

Thanks in advance

Hi, Everyone.

Reviving this thread…

Has anyone managed to incorporate a date picker on there App? Any references available for Ionic 2?

Thank you!

Hi,

if it’s any help, in the update to @beta7 they have added this component

how to set today’s on on datetime ?
I tried setting myDate = new Date(); but its now working

HI , I use this and its woking
> transferDate : string;

todayDate(datetoDay :string) :void{ let utc = new Date().toJSON().slice(0,10); if (datetoDay === undefined ){ this.transferDate = utc; } }

then :

ionViewLoaded(){

this.todayDate(this.transferDate);
}

and in the view

<ion-item class="text-label">
        <ion-label primary>Date:</ion-label>
        <ion-datetime displayFormat="DD/MMM/YYYY"  min="2016" max="2018-12-31"[(ngModel)]="transferDate"></ion-datetime>
  </ion-item>
2 Likes

Hi all I’m new to Ionic 2 , how can i do ionic 2 date picker ?..is there any solution and example plunker’s is available ?..if any one knew the solution please help us to do the ionic 2 date picker in my app…

@manie21 had u got any solution.At present i am working on that.Did you get any answer please tell me

@saikrishna nope…!!! still i am searching for the solution… if you got the answer let me know sai…

@manie21 http://stackoverflow.com/questions/42274862/how-to-enable-and-disable-the-dates-in-ionic-2 this is what we had got.I am able to display the calendar but the ui changes from one version to another version.

@saikrishan i have simply used this link method:- https://ionicframework.com/docs/v2/components/#datetime in my app so you just look at the link for referrence…

@manie21 i should display calendar in my project.So if u have any knowledge let me know

@manie21 is the code is usefull for you what i had posted in stack

@manie21 i had and displayed the calendar in ui

Are you found the solution? if you found can you answer your own question in stackflow?

How to enable only monday in ionic 2 native datepicker??? anyone knows the solution??