From 31c5a53594b94202200d5c329bfee912de4c003c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20Lis=C3=A9?= Date: Wed, 8 Feb 2023 14:19:43 -0800 Subject: [PATCH] BRS-1041: Update date control UI when they select a future date. (#213) * BRS-1041: Update date control UI when they select a future date. * Update lockfile. --- package.json | 2 +- .../sub-area-search/sub-area-search.component.ts | 11 +++++++++-- yarn.lock | 8 ++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index bece13f..1b7d94c 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "keycloak-angular": "^13.0.0", "keycloak-js": "^20.0.2", "moment": "^2.29.4", - "ngx-bootstrap": "^10.1.0", + "ngx-bootstrap": "^10.2.0", "ngx-toastr": "^16.0.1", "popper.js": "^1.16.1", "rxjs": "7.6.0", diff --git a/src/app/enter-data/sub-area-search/sub-area-search.component.ts b/src/app/enter-data/sub-area-search/sub-area-search.component.ts index 5fbb01e..fdcc04f 100644 --- a/src/app/enter-data/sub-area-search/sub-area-search.component.ts +++ b/src/app/enter-data/sub-area-search/sub-area-search.component.ts @@ -7,6 +7,8 @@ import { Constants } from 'src/app/shared/utils/constants'; import { ActivatedRoute, Router } from '@angular/router'; import { Utils } from 'src/app/shared/utils/utils'; import { FormService } from 'src/app/services/form.service'; +import { ChangeDetectorRef } from '@angular/core'; +import { setTime } from 'ngx-bootstrap/chronos/utils/date-setters'; @Component({ selector: 'app-sub-area-search', @@ -43,7 +45,8 @@ export class SubAreaSearchComponent implements OnDestroy { protected subAreaService: SubAreaService, private router: Router, private activatedRoute: ActivatedRoute, - private formService: FormService + private formService: FormService, + private cRef: ChangeDetectorRef ) { this.subscriptions.add( dataService @@ -77,7 +80,11 @@ export class SubAreaSearchComponent implements OnDestroy { }, }); } else { - this.modelDate = this.previousDateChosen; + const self = this; + setTimeout(() => { + this.modelDate = this.previousDateChosen; + self.cRef.detectChanges(); + }, 50) } } diff --git a/yarn.lock b/yarn.lock index 44e205e..c338024 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5028,10 +5028,10 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -ngx-bootstrap@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/ngx-bootstrap/-/ngx-bootstrap-10.1.0.tgz#025664bc86d11d2f3372cb5ac98d49d397e6f0db" - integrity sha512-IgC4+ZmfG0fTTq6XoA0SZ/qgQmua8dvFDerhqgQ3cKKrdD334sSH/RztJLKNdr0UtFUVgN8TWcrHPYEX8myhOg== +ngx-bootstrap@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/ngx-bootstrap/-/ngx-bootstrap-10.2.0.tgz#5ae8b0a3b3f0bec2f0229556f059be57dd602871" + integrity sha512-bn5wdvH6QQ2JGu4TgUbozdULBFMxZNPNTgO7dRiosx9FRrFvKcgxkGSgU/xoj+4kP1vgh8zwzaiDfvH/Bfb+Aw== dependencies: tslib "^2.3.0"