Quantcast
Viewing latest article 4
Browse Latest Browse All 16

Bootstrap from Twitter is missing a date-picker

Bootstrap is awesome, light weight. I think it is a great replacement of JQuery UI. But there are still a few elements missing from Bootstrap. Such as the very important one: date picker.

I found someone has done a plugin for it. It is pretty cool.

Here it is. http://www.eyecon.ro/bootstrap-datepicker/

To create a date picker, write the markups as follow,

    <div class="input-append date" id="dp3">

    <span class="add-on"><i class="icon-th"></i></span>
    </div>

Image may be NSFW.
Clik here to view.
image

Call the javascripts,

$('.datepicker').datepicker()

There are a few events that you can register as well,

show

This event fires immediately when the date picker is displayed.

hide

This event is fired immediately when the date picker is hidden.

changeDate

This event is fired when the date is changed.

    $('#dp5').datepicker()
    .on('changeDate', function(ev){
    if (ev.date.valueOf() < startDate.valueOf()){
    ....
    }
    });

————————-

Good stuff!


Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing latest article 4
Browse Latest Browse All 16

Trending Articles