From 269acf98608f636b0d362b5417284ec03a50fba4 Mon Sep 17 00:00:00 2001 From: Jen Beckett <115109120+jenbeckett@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:01:38 -0700 Subject: [PATCH 1/5] Update SupplementaryFormView for hotfix date change --- .../src/views/supp-allowances/SupplementaryFormView.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/supp-allowances/SupplementaryFormView.vue b/frontend/src/views/supp-allowances/SupplementaryFormView.vue index c9782e0e..03313ba2 100644 --- a/frontend/src/views/supp-allowances/SupplementaryFormView.vue +++ b/frontend/src/views/supp-allowances/SupplementaryFormView.vue @@ -555,9 +555,9 @@ export default { }, setSuppTermDates() { const today = new Date() - const formattedEndDate = new Date(this.fundingAgreement.endDate) - const formattedStartDate = new Date(this.fundingAgreement.startDate) - const daysOfTerm = moment.duration(moment(formattedEndDate).diff(moment(formattedStartDate))).asDays() + const formattedEndDate = moment(this.fundingAgreement?.endDate).endOf('day').toDate() + const termTwoEndDate = moment(formattedEndDate).subtract(1, 'years').endOf('day').toDate() + const termOneEndDate = moment(formattedEndDate).subtract(2, 'years').endOf('day').toDate() let termTwoEndDate let termOneEndDate From d673748d1398359f5cb936ec41f5addac98b1903 Mon Sep 17 00:00:00 2001 From: Jen Beckett <115109120+jenbeckett@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:55:38 -0700 Subject: [PATCH 2/5] Update SupplementaryFormView.vue --- .../src/views/supp-allowances/SupplementaryFormView.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/supp-allowances/SupplementaryFormView.vue b/frontend/src/views/supp-allowances/SupplementaryFormView.vue index 03313ba2..cb37548c 100644 --- a/frontend/src/views/supp-allowances/SupplementaryFormView.vue +++ b/frontend/src/views/supp-allowances/SupplementaryFormView.vue @@ -556,19 +556,17 @@ export default { setSuppTermDates() { const today = new Date() const formattedEndDate = moment(this.fundingAgreement?.endDate).endOf('day').toDate() - const termTwoEndDate = moment(formattedEndDate).subtract(1, 'years').endOf('day').toDate() - const termOneEndDate = moment(formattedEndDate).subtract(2, 'years').endOf('day').toDate() let termTwoEndDate let termOneEndDate //ofmcc-6357- allow supp terms to work with both a FA term of 2 and 3 years in length //this will account for leap years as a standard non leap year term would be 729 days. if (daysOfTerm > TWO_YEARS) { - termTwoEndDate = moment(formattedEndDate).subtract(1, 'years').toDate() - termOneEndDate = moment(formattedEndDate).subtract(2, 'years').toDate() + termTwoEndDate = moment(formattedEndDate).subtract(1, 'years').endOf('day').toDate() + termOneEndDate = moment(formattedEndDate).subtract(2, 'years').endOf('day').toDate() } else { termTwoEndDate = formattedEndDate - termOneEndDate = moment(formattedEndDate).subtract(1, 'years').toDate() + termOneEndDate = moment(formattedEndDate).subtract(1, 'years').endOf('day').toDate() } switch (true) { From 446a370b016e6547f21e85d7a22780a32c46116c Mon Sep 17 00:00:00 2001 From: Jen Beckett <115109120+jenbeckett@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:56:10 -0700 Subject: [PATCH 3/5] Update SupplementaryFormView.vue --- frontend/src/views/supp-allowances/SupplementaryFormView.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/views/supp-allowances/SupplementaryFormView.vue b/frontend/src/views/supp-allowances/SupplementaryFormView.vue index cb37548c..33790091 100644 --- a/frontend/src/views/supp-allowances/SupplementaryFormView.vue +++ b/frontend/src/views/supp-allowances/SupplementaryFormView.vue @@ -558,6 +558,7 @@ export default { const formattedEndDate = moment(this.fundingAgreement?.endDate).endOf('day').toDate() let termTwoEndDate let termOneEndDate + const daysOfTerm = moment.duration(moment(formattedEndDate).diff(moment(formattedStartDate))).asDays() //ofmcc-6357- allow supp terms to work with both a FA term of 2 and 3 years in length //this will account for leap years as a standard non leap year term would be 729 days. From 249beb027304fe6b50f16da0aef838ffa69bc46f Mon Sep 17 00:00:00 2001 From: Jen Beckett <115109120+jenbeckett@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:56:45 -0700 Subject: [PATCH 4/5] Update SupplementaryFormView.vue --- frontend/src/views/supp-allowances/SupplementaryFormView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/supp-allowances/SupplementaryFormView.vue b/frontend/src/views/supp-allowances/SupplementaryFormView.vue index 33790091..a2a55ce3 100644 --- a/frontend/src/views/supp-allowances/SupplementaryFormView.vue +++ b/frontend/src/views/supp-allowances/SupplementaryFormView.vue @@ -556,9 +556,9 @@ export default { setSuppTermDates() { const today = new Date() const formattedEndDate = moment(this.fundingAgreement?.endDate).endOf('day').toDate() + const daysOfTerm = moment.duration(moment(formattedEndDate).diff(moment(formattedStartDate))).asDays() let termTwoEndDate let termOneEndDate - const daysOfTerm = moment.duration(moment(formattedEndDate).diff(moment(formattedStartDate))).asDays() //ofmcc-6357- allow supp terms to work with both a FA term of 2 and 3 years in length //this will account for leap years as a standard non leap year term would be 729 days. From 39b9da676bfa7a3b36a5c91be39b5821e3ca7f9e Mon Sep 17 00:00:00 2001 From: Jen Beckett <115109120+jenbeckett@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:57:41 -0700 Subject: [PATCH 5/5] Update SupplementaryFormView.vue --- frontend/src/views/supp-allowances/SupplementaryFormView.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/views/supp-allowances/SupplementaryFormView.vue b/frontend/src/views/supp-allowances/SupplementaryFormView.vue index a2a55ce3..1ddd92e8 100644 --- a/frontend/src/views/supp-allowances/SupplementaryFormView.vue +++ b/frontend/src/views/supp-allowances/SupplementaryFormView.vue @@ -556,6 +556,7 @@ export default { setSuppTermDates() { const today = new Date() const formattedEndDate = moment(this.fundingAgreement?.endDate).endOf('day').toDate() + const formattedStartDate = new Date(this.fundingAgreement.startDate) const daysOfTerm = moment.duration(moment(formattedEndDate).diff(moment(formattedStartDate))).asDays() let termTwoEndDate let termOneEndDate