forked from akveo/blur-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app\form inputs): add datepicker
- Loading branch information
1 parent
e2c27bd
commit 37a748c
Showing
5 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/app/pages/form/inputs/widgets/datePickers/datePickers.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<div class="datepicker row"> | ||
<div class="col-sm-6" ng-controller="datepickerCtrl"> | ||
<h4>Inline</h4> | ||
<label>Selected date is: <em>{{dt | date:'fullDate' }}</em></label> | ||
<div class="uib-datepicker-wrap"> | ||
<uib-datepicker ng-model="dt" datepicker-options="options"></uib-datepicker> | ||
</div> | ||
</div> | ||
|
||
<div class="col-sm-6" ng-controller="datepickerpopupCtrl"> | ||
<h4>Popup</h4> | ||
<label>Selected date is: <em>{{dt | date:'fullDate' }}</em></label> | ||
<p class="input-group"> | ||
<input type="text" class="form-control" uib-datepicker-popup="{{format}}" datepicker-options="options" ng-model="dt" is-open="opened" ng-required="true" close-text="Close" alt-input-formats="altInputFormats" show-button-bar="false" /> | ||
<span class="input-group-btn"> | ||
<button type="button" class="btn btn-default" ng-click="open()"><i class="glyphicon glyphicon-calendar"></i></button> | ||
</span> | ||
</p> | ||
<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> | ||
|
||
</div> |
20 changes: 20 additions & 0 deletions
20
src/app/pages/form/inputs/widgets/datePickers/datepickerCtrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Created by n.poltoratsky | ||
* on 23.06.2016. | ||
*/ | ||
(function(){ | ||
'use strict'; | ||
|
||
angular.module('BlurAdmin.pages.form') | ||
.controller('datepickerCtrl', datepickerCtrl); | ||
|
||
/** @ngInject */ | ||
function datepickerCtrl($scope) { | ||
|
||
$scope.dt = new Date(); | ||
$scope.options = { | ||
showWeeks: false | ||
}; | ||
|
||
} | ||
})(); |
26 changes: 26 additions & 0 deletions
26
src/app/pages/form/inputs/widgets/datePickers/datepickerpopupCtrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Created by n.poltoratsky | ||
* on 23.06.2016. | ||
*/ | ||
(function(){ | ||
'use strict'; | ||
|
||
angular.module('BlurAdmin.pages.form') | ||
.controller('datepickerpopupCtrl', datepickerpopupCtrl); | ||
|
||
/** @ngInject */ | ||
function datepickerpopupCtrl($scope) { | ||
|
||
$scope.open = open; | ||
$scope.opened = false; | ||
$scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate']; | ||
$scope.format = $scope.formats[0]; | ||
$scope.options = { | ||
showWeeks: false | ||
}; | ||
|
||
function open() { | ||
$scope.opened = true; | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.datepicker { | ||
.btn:hover { | ||
transform: scale(1); | ||
} | ||
|
||
button.btn.btn-default { | ||
background-color: transparent; | ||
} | ||
|
||
button.btn.btn-default.active { | ||
background-color: $info; | ||
color: white; | ||
} | ||
|
||
button.btn.active span.ng-binding.text-info { | ||
color: white; | ||
} | ||
} | ||
|
||
.uib-datepicker-wrap { | ||
display:inline-block; | ||
min-height:270px; | ||
} | ||
|
||
.uib-datepicker span.ng-binding.text-muted { | ||
color: $default-text; | ||
} | ||
.uib-datepicker-popup { | ||
|
||
background-color: $bootstrap-panel-bg; | ||
border-width: 0; | ||
color: black; | ||
|
||
button.btn { | ||
color: black; | ||
|
||
.text-muted { | ||
color: black; | ||
} | ||
} | ||
|
||
.glyphicon { | ||
color: rgba($progress-background, 1); | ||
} | ||
} |