mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 02:00:01 -03:30
[system_tracking] Disable dates on right prior to dates on left
This commit is contained in:
@@ -12,7 +12,8 @@ export default
|
|||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
scope: {
|
scope: {
|
||||||
date: '='
|
date: '=',
|
||||||
|
minDate: '='
|
||||||
},
|
},
|
||||||
templateUrl: '/static/js/system-tracking/date-picker/date-picker.partial.html',
|
templateUrl: '/static/js/system-tracking/date-picker/date-picker.partial.html',
|
||||||
link: function(scope, element, attrs) {
|
link: function(scope, element, attrs) {
|
||||||
@@ -21,6 +22,12 @@ export default
|
|||||||
// with two-way binding.
|
// with two-way binding.
|
||||||
var mustUpdateValue = true;
|
var mustUpdateValue = true;
|
||||||
|
|
||||||
|
scope.$watch('minDate', function(newValue) {
|
||||||
|
if (newValue) {
|
||||||
|
$('.date', element).systemTrackingDP('setStartDate', newValue.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
scope.$watch('date', function(newValue) {
|
scope.$watch('date', function(newValue) {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
mustUpdateValue = false;
|
mustUpdateValue = false;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="FactModulePickers-dateContainer FactModulePickers-dateContainer--right" ng-show="compareMode == 'single-host'">
|
<div class="FactModulePickers-dateContainer FactModulePickers-dateContainer--right" ng-show="compareMode == 'single-host'">
|
||||||
<span class="FactModulePickers-label">{{ factModulePickersLabelRight }}</span>
|
<span class="FactModulePickers-label">{{ factModulePickersLabelRight }}</span>
|
||||||
<date-picker date="rightDate"></date-picker>
|
<date-picker date="rightDate" min-date="leftDate"></date-picker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user