diff --git a/projects/common/src/fm/components/has-package/has-package.directive.ts b/projects/common/src/fm/components/has-package/has-package.directive.ts index 9a4d202..9c4a6a8 100644 --- a/projects/common/src/fm/components/has-package/has-package.directive.ts +++ b/projects/common/src/fm/components/has-package/has-package.directive.ts @@ -16,7 +16,11 @@ export class HasPackageDirective implements OnInit,OnDestroy{ private packSub:Subscription; ngOnInit() { this.packages$.subscribe((packages) => { - if (packages[this.package] && packages[this.package].enabled) { + const today = new Date(Date.now()).setHours(0,0,0,0); + if (packages[this.package] && + packages[this.package].enabled && + (packages[this.package].DataDate && new Date(packages[this.package].DataDate).setHours(0, 0, 0, 0) <= today) && + (packages[this.package].DataEndDate == null || new Date(packages[this.package].DataEndDate).setHours(0, 0, 0, 0) >= today)) { this.viewContainerRef$.createEmbeddedView(this.templateRef$); this.hasView=true; } else if (this.hasView) {