将2个有角度的日期拣选器并排放置而不是顶部和下部

时间:2014-07-07 07:22:12

标签: html angularjs datepicker angular-ui-bootstrap bootstrap-datepicker

我正在使用2个Angularjs-ui boorstrap datepickers。 http://angular-ui.github.io/bootstrap/

我想将2个日期选择器并排放置。不幸的是,我的html代码将它们放在一个顶部,另一个放在下面。我的HTML代码看起来像这样;

<h4>Start date</h4>
        <div class="row"">
            <div class="col-md-6">
                <p class="input-group">
                  <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" 
                         datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" 
                         close-text="Close" />
                  <span class="input-group-btn">
                    <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                  </span>
                </p>
            </div>
        </div> <!-- <div class="row"> Registration start date -->   
<h4>End date</h4>
    <div class="row">
        <div class="col-md-6">
            <p class="input-group">
              <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" 
                     datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" 
                     close-text="Close" />
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
              </span>
            </p>
        </div>
    </div> 

如何更改html代码以使2个日期选择器(带标题文本)并排显示?

1 个答案:

答案 0 :(得分:2)

<div class="row">
    <div class="col-md-6">
        <span>Start date</span>
    </div>
    <div class="col-md-6">
        <span>End date</span>
    </div>
</div>
<div class="row">
    <div class="col-md-6">
        <p class="input-group">
            <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened"
                   datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true"
                   close-text="Close" />
            <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
            </span>
        </p>
    </div>
    <div class="col-md-6">
        <p class="input-group">
            <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened"
                   datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true"
                   close-text="Close" />
            <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
            </span>
        </p>
    </div>
</div>