Bootstrap Angular UI Starting Point

AngularJS + Angular Bootstrap

by jdavidroberts

HTML

<script src="http://raw.github.com/angular-ui/angular-ui/master/build/angular-ui.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
<script src="https://raw.githubusercontent.com/angular-ui/bootstrap/gh-pages/ui-bootstrap-tpls-0.11.0.min.js"></script>
<div class="panel-body container-fluid" ng-controller="documentSearchController">
    <div class="well well-lg container-fluid form-horizontal">
        <div class="form-group">
            <label for="idStartDate" class="col-md-2 control-label">Received After</label>
            <p class="col-md-2 input-group">
                <input type="text" class="form-control" datepicker-popup="MM/dd/yyyy" ng-model="startDate"
                       is-open="startDateOpened" max-date="endDate || today" datepicker-options="dateOptions"
                       placeholder="Received after" id="idStartDate"/>
                <span class="input-group-btn">
                  <button type="button" class="btn btn-default" ng-click="openStartDate($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                </span>
            </p>
        </div>
        <div class="form-group">
            <label for="idStartTime" class="col-md-2 control-label">Time</label>
            <div class="col-md-2">
                <timepicker id="idStartTime" ng-model="startTime" minute-step="15"></timepicker>
            </div>
        </div>
    </div>
</div>

JavaScript

var myApp = angular.module('myApp',[]);

//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});

var documentSearchCtrl = myApp.controller('documentSearchController', ['$scope', '$location', 'documentSearchService', 'UIFramework',
                                                                       function($scope, $location, documentSearchService, UIFramework){

    $scope.today = new Date();
    $scope.startTime = $scope.endTime = "1/1/1970 00:00:00";

    $scope.openStartDate = function($event) {
        
      shuntEvent($event);
      $scope.startDateOpened = true;
    };

    $scope.openEndDate = function($event) {
      $event.preventDefault();
      $event.stopPropagation();

      $scope.endDateOpened = true;
    };

    $scope.dateOptions = {
      showWeeks: false
    };
    
    $scope.isCollapsed = true;
}]);