Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

docs(datepicker): remove popup example. #5755

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions src/datepicker/docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,7 @@

<h4>Inline</h4>
<div style="display:inline-block; min-height:290px;">
<uib-datepicker ng-model="dt" class="well well-sm" datepicker-options="inlineOptions"></uib-datepicker>
</div>

<h4>Popup</h4>
<div class="row">
<div class="col-md-6">
<p class="input-group">
<input type="text" class="form-control" uib-datepicker-popup="{{format}}" ng-model="dt" is-open="popup1.opened" datepicker-options="dateOptions" ng-required="true" close-text="Close" alt-input-formats="altInputFormats" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open1()"><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" uib-datepicker-popup ng-model="dt" is-open="popup2.opened" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open2()"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Format: <span class="muted-text">(manual alternate <em>{{altInputFormats[0]}}</em>)</span></label> <select class="form-control" ng-model="format" ng-options="f for f in formats"><option></option></select>
</div>
<uib-datepicker ng-model="dt" class="well well-sm" datepicker-options="options"></uib-datepicker>
</div>

<hr />
Expand Down
33 changes: 2 additions & 31 deletions src/datepicker/docs/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,12 @@ angular.module('ui.bootstrap.demo').controller('DatepickerDemoCtrl', function ($
$scope.dt = null;
};

$scope.inlineOptions = {
$scope.options = {
customClass: getDayClass,
minDate: new Date(),
showWeeks: true
};

$scope.dateOptions = {
dateDisabled: disabled,
formatYear: 'yy',
maxDate: new Date(2020, 5, 22),
minDate: new Date(),
startingDay: 1
};

// Disable weekend selection
function disabled(data) {
var date = data.date,
Expand All @@ -30,36 +22,15 @@ angular.module('ui.bootstrap.demo').controller('DatepickerDemoCtrl', function ($
}

$scope.toggleMin = function() {
$scope.inlineOptions.minDate = $scope.inlineOptions.minDate ? null : new Date();
$scope.dateOptions.minDate = $scope.inlineOptions.minDate;
$scope.options.minDate = $scope.options.minDate ? null : new Date();
};

$scope.toggleMin();

$scope.open1 = function() {
$scope.popup1.opened = true;
};

$scope.open2 = function() {
$scope.popup2.opened = true;
};

$scope.setDate = function(year, month, day) {
$scope.dt = new Date(year, month, day);
};

$scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
$scope.format = $scope.formats[0];
$scope.altInputFormats = ['M!/d!/yyyy'];

$scope.popup1 = {
opened: false
};

$scope.popup2 = {
opened: false
};

var tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
var afterTomorrow = new Date(tomorrow);
Expand Down