From ff8880dd2aa37b4dc3291a2dbbc1e7454f02b59d Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 1 Aug 2019 22:18:20 -0600 Subject: [PATCH] Auto hide VBS --- Client/src/app/components/home/home.component.html | 2 +- Client/src/app/components/home/home.component.ts | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Client/src/app/components/home/home.component.html b/Client/src/app/components/home/home.component.html index 10ef7d2..89b809b 100644 --- a/Client/src/app/components/home/home.component.html +++ b/Client/src/app/components/home/home.component.html @@ -11,7 +11,7 @@
-
+
diff --git a/Client/src/app/components/home/home.component.ts b/Client/src/app/components/home/home.component.ts index 59d762a..a15ffda 100644 --- a/Client/src/app/components/home/home.component.ts +++ b/Client/src/app/components/home/home.component.ts @@ -23,7 +23,19 @@ export class HomeComponent { return true; } public get showCallToAction(): boolean { - let maxDate = new Date(2019,6,8); // September 6th 2018 -- Set the month one month behind since JavaScript dates are 0 based + let maxDate = new Date(2019,6,8); // July 8th 2018 -- Set the month one month behind since JavaScript dates are 0 based + let now = new Date(); + if (now.getFullYear() > maxDate.getFullYear()) return false; + if (now.getFullYear() == maxDate.getFullYear()) { + if (now.getMonth() > maxDate.getMonth()) return false; + if (now.getMonth() == maxDate.getMonth()) { + if (now.getDate() > maxDate.getDate()) return false; + } + } + return true; + } + public get showVBS(): boolean { + let maxDate = new Date(2019,7,22); // August 22nd 2018 -- Set the month one month behind since JavaScript dates are 0 based let now = new Date(); if (now.getFullYear() > maxDate.getFullYear()) return false; if (now.getFullYear() == maxDate.getFullYear()) {