# Need Help Getting a DatePicker working, Please and thanks!

**URL:** <https://forum.ionicframework.com/t/need-help-getting-a-datepicker-working-please-and-thanks/15771>\
**Category:** ionic-v1\
**Created:** [January 15, 2015, 3:10pm UTC](https://forum.ionicframework.com/t/need-help-getting-a-datepicker-working-please-and-thanks/15771 "2015-01-15T15:10:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BioPerl](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@BioPerl](https://forum.ionicframework.com/u/BioPerl)\
**Post date:** [January 15, 2015, 3:10pm UTC](https://forum.ionicframework.com/t/need-help-getting-a-datepicker-working-please-and-thanks/15771/1 "2015-01-15T15:10:04Z")

</div>

Hey guys,

I need to get a datepicker working and then use the date to do some math (determine how far away it is, and so on).

Coming from a web development background my first instinct was `<input type="date">` but my research showed this doesn’t work on all android devices, and that its device specific not android verions specific… example: Samsung Galaxy S2 on Android 4.0.3 does support it, but the Google/Samsung Nexus S on the more recent Android 4.0.4 does not.

So I started looking at plugins and found this one [https://github.com/VitaliiBlagodir/cordova-plugin-datepicker](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker) and installed it successfully using the cordova CLI but can’t get the datepicker to work…

using this code to try and initializing it…

```
 /**
     * Function to show the date picker
     */
    $scope.showDatePicker = function($event) {
        var options = {
            date: new Date(),
            mode: 'date'
        };
        datePicker.show(options, function(date){
            if(date != 'Invalid Date') {
                console.log("Date came" + date);
            } else {
                console.log(date);
            }
        });
        $event.stopPropagation();  
    }; 

```

but failing to do so… am i missing something big here?

any help would be great, I’ve spent several days trying multiple plugins and various trouble shooting methods with no luck.

---

<div class="post-metadata">

**Author:** ![jimibi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jimibi/32/7945_2.png) [@jimibi](https://forum.ionicframework.com/u/jimibi)\
**Post date:** [January 15, 2015, 3:47pm UTC](https://forum.ionicframework.com/t/need-help-getting-a-datepicker-working-please-and-thanks/15771/2 "2015-01-15T15:47:53Z")

</div>

Take a look at this post: [http://forum.ionicframework.com/t/calendar-control-for-ionic/1536](http://forum.ionicframework.com/t/calendar-control-for-ionic/1536)

And for calculation I use this two libraries:  
-[https://github.com/tdd/moments-away](https://github.com/tdd/moments-away)  
-[http://momentjs.com/](http://momentjs.com/)

---

<div class="post-metadata">

**Author:** ![BioPerl](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@BioPerl](https://forum.ionicframework.com/u/BioPerl)\
**Post date:** [January 15, 2015, 4:38pm UTC](https://forum.ionicframework.com/t/need-help-getting-a-datepicker-working-please-and-thanks/15771/3 "2015-01-15T16:38:04Z")

</div>

thanks, I did not know about moments. will give it a look through.

ended up just doing the datepicker a very dirty angular way without a plugin as if it was just a website. it works, and thats farther than I got all week.

thanks again for your help!

---

<div class="post-metadata">

**Author:** ![rajeshwarpatlolla](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rajeshwarpatlolla/32/70759_2.png) [@rajeshwarpatlolla](https://forum.ionicframework.com/u/rajeshwarpatlolla)\
**Post date:** [April 23, 2015, 5:43am UTC](https://forum.ionicframework.com/t/need-help-getting-a-datepicker-working-please-and-thanks/15771/4 "2015-04-23T05:43:42Z")

</div>

Hi @BioPerl, I have created both time picker and date picker for ionic frame works.  
No additional dependencies like jQuery is not required. Hope this might help you. Please have a look at the below links.

[ionic-timepicker demo](http://forum.ionicframework.com/t/time-picker-for-ionic-framework/13409)

[ionic-timepicker Bower component](http://forum.ionicframework.com/t/ionic-timepicker-bower-component/17929/2)

[ionic-datepicker demo](http://forum.ionicframework.com/t/a-date-picker-for-ionic-framework-applications/21515)

[ionic-datepicker Bower component](http://forum.ionicframework.com/t/ionic-datepicker-bower-component-for-ionic-framework-applications/21516)

---

<div class="post-metadata">

**Author:** ![Primotus](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@Primotus](https://forum.ionicframework.com/u/Primotus)\
**Post date:** [February 24, 2016, 10:21pm UTC](https://forum.ionicframework.com/t/need-help-getting-a-datepicker-working-please-and-thanks/15771/5 "2016-02-24T22:21:15Z")

</div>

> [@rajeshwarpatlolla](#):
>
> [Calendar control for ionic](http://forum.ionicframework.com/t/calendar-control-for-ionic/1536)

Hi Rajesh  
I tried out your date pickerand like it a lot. I was wondering if you had a plugin that combined both tools into one. datetime picker.

Thanks for the great lib.

---

<div class="post-metadata">

**Author:** ![rajeshwarpatlolla](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rajeshwarpatlolla/32/70759_2.png) [@rajeshwarpatlolla](https://forum.ionicframework.com/u/rajeshwarpatlolla)\
**Post date:** [February 25, 2016, 5:26am UTC](https://forum.ionicframework.com/t/need-help-getting-a-datepicker-working-please-and-thanks/15771/6 "2016-02-25T05:26:53Z")

</div>

These two are two different plugins for now. You need to install the two plugins separately.
