Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

with correct form input input prepend / append is on wrong div #111

Merged
merged 1 commit into from

2 participants

@fivethreeo

class should not be on control-group

e.g.

<script type="text/javascript">
    $(document).ready(function() {
        $('#div_id_til').datetimepicker({
            format: 'yyyy-MM-dd hh:mm',
            language: 'nb-NO'
        });
    });
</script>

This breaks the layout:

<div id="div_id_til" class="control-group input-append">
    <label for="id_til" class="control-label required-field">Til</label>
    <div class="controls">
            <input name="til" type="text" id="id_til" value="2013-04-10 23:59" />
            <span class="add-on">
                <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
            </span>
            <p class="help-block">Når arrangementet slutter</p>
    </div>
</div>

This breaks the js:

<div id="div_id_til" class="control-group">
    <label for="id_til" class="control-label required-field">Til</label>
    <div class="controls">
        <div class="input-append">
            <input name="til" type="text" id="id_til" value="2013-04-10 23:59" />
            <span class="add-on">
                <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
            </span>
            <p class="help-block">Når arrangementet slutter</p>
        </div>
    </div>
</div>

This pull fixes the problem with the js

@tarruda tarruda merged commit 3610b3a into tarruda:master
@tarruda
Owner

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 12, 2013
  1. @fivethreeo

    make the picker work with correct form markup

    fivethreeo authored
    class should not be on control-group
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/js/bootstrap-datetimepicker.js
View
2  src/js/bootstrap-datetimepicker.js
@@ -54,7 +54,7 @@
this.pickTime = options.pickTime;
this.isInput = this.$element.is('input');
this.component = false;
- if (this.$element.is('.input-append') || this.$element.is('.input-prepend'))
+ if (this.$element.find('.input-append') || this.$element.find('.input-prepend'))
this.component = this.$element.find('.add-on');
this.format = options.format;
if (!this.format) {
Something went wrong with that request. Please try again.