From 4bca8ae5875f64b1d3ca52ad5beb291cd75d7cb8 Mon Sep 17 00:00:00 2001 From: Jen Beckett <115109120+jenbeckett@users.noreply.github.com> Date: Tue, 5 Nov 2024 12:18:29 -0800 Subject: [PATCH 1/2] added a day --- 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 da6c4ec4..53a5226a 100644 --- a/frontend/src/views/supp-allowances/SupplementaryFormView.vue +++ b/frontend/src/views/supp-allowances/SupplementaryFormView.vue @@ -203,7 +203,7 @@ import moment from 'moment' const DAYS_BEFORE_TERM_EXPIRES = 1 const DAYS_BEFORE_NEXT_TERM_ENABLED = 120 -const TWO_YEARS = 730 +const TWO_YEARS = 731 export default { name: 'SupplementaryFormView', From a048a6690a310887808db9657dffd727201f21f0 Mon Sep 17 00:00:00 2001 From: Jen Beckett <115109120+jenbeckett@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:58:04 -0800 Subject: [PATCH 2/2] few more fixes related to the date --- .../src/views/supp-allowances/SupplementaryFormView.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/supp-allowances/SupplementaryFormView.vue b/frontend/src/views/supp-allowances/SupplementaryFormView.vue index 53a5226a..34bfcd24 100644 --- a/frontend/src/views/supp-allowances/SupplementaryFormView.vue +++ b/frontend/src/views/supp-allowances/SupplementaryFormView.vue @@ -30,7 +30,8 @@ - + +
If you apply for and receive funding in the current year of your funding agreement, the funds must be used by {{ format.formatDateToUTC(fundingExpiryDate) }}
@@ -203,7 +204,7 @@ import moment from 'moment' const DAYS_BEFORE_TERM_EXPIRES = 1 const DAYS_BEFORE_NEXT_TERM_ENABLED = 120 -const TWO_YEARS = 731 +const TWO_YEARS = 732 export default { name: 'SupplementaryFormView', @@ -557,7 +558,7 @@ export default { 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() + const daysOfTerm = Math.floor(moment.duration(moment(formattedEndDate).diff(moment(formattedStartDate))).asDays()) let termTwoEndDate let termOneEndDate