Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the recommended date picker for AngularJS/Bootstrap? [closed]

There are several choices for adding a date picker control when using Angular/Bootstrap. Is there one that is "better"?

Here is what I have found:

  • HTML 5 input type of date: Inconsistent support in different browsers
  • angular-ui/ui-date: Seems to be a simple directive-based solution wrapped around the JQueryUI date picker.
  • ui.bootstrap.datepicker: Provides a pop-up style that users may like and has no dependency on JQuery.

At first glance, it seemed that the Bootstrap date picker may be easier to use because it does not require including JQuery. But I wasn't sure if I was losing any functionality going that way.

like image 215
DeborahK Avatar asked Jul 01 '14 16:07

DeborahK


1 Answers

Angular-ui's bootstrap datepicker is the better choice if you already include bootstrap in your angular project. With the newer version of Angular, input types of date can be parsed in both directions and will work great with angular-ui bootstrap datepicker. (with older version, you can 'patch' angular to work with date input types). Of course the angular-ui datepicker can work without the date input type as well (its just an added bonus)

Before using the angular-ui bootstrap datepicker, we used jquery ui's datepicker and had some problem around the value of the date not being a javascript date. At first it was fine and did everything we wanted, but when trying to do more complex things we ran into problems.

You could probably solve the jquery ui problems by making your own directive and getting into the nitty-gritty, but angular-ui's bootstrap datepicker just works out-of-the-box.

like image 111
TheSharpieOne Avatar answered Nov 15 '22 11:11

TheSharpieOne