vitalets / combodate

Dropdown date and time picker
http://vitalets.github.com/combodate
207 stars 82 forks source link

Bootstrap? #49

Open kylecdrck opened 8 years ago

kylecdrck commented 8 years ago

How do you apply the form-control class on the combodate? I tried editing the js and the tags but they mess up the layout

jcope2013 commented 8 years ago

wondering the same, any success?

kylecdrck commented 8 years ago

I modified the combodate.js and replaced line 96 with

                tpl = tpl.replace('{'+token+'}', '<div class="col-sm-3"><select class="form-control '+k+' '+customClass+'"></select></div>');
jamesantrobus commented 8 years ago

You can use the customClass option. Used as a data attribute it should look likedata-custom-class="form-control".

rtsalamone commented 8 years ago

In addition to @jamesantrobus suggestion, I found the following additional css useful to keep the fields on one line:

.combodate {display:block}
.combodate .form-control {display:inline-block}
Actually, it's just a start — I also added some % width's for the individual form-control fields. But these rules will vary depending on which fields/formats you're using (e.g. when inputting month & year vs month & day & year), so I didn't include them here.