diff --git a/frontend/src/components/Contributions/ContributionForm.spec.js b/frontend/src/components/Contributions/ContributionForm.spec.js index d3cc315a5..b107d7d69 100644 --- a/frontend/src/components/Contributions/ContributionForm.spec.js +++ b/frontend/src/components/Contributions/ContributionForm.spec.js @@ -73,7 +73,7 @@ describe('ContributionForm', () => { }) }) - describe('actual date', () => { + describe.only('actual date', () => { describe('same month', () => { beforeEach(async () => { const now = new Date().toISOString() diff --git a/frontend/src/components/Contributions/ContributionForm.vue b/frontend/src/components/Contributions/ContributionForm.vue index 2ee94db58..52438d175 100644 --- a/frontend/src/components/Contributions/ContributionForm.vue +++ b/frontend/src/components/Contributions/ContributionForm.vue @@ -131,11 +131,18 @@ export default { }, }, computed: { - // sets the date to the 1st of the previous month minimalDate() { + // sets the date to the 1st of the previous month const month = this.maximalDate.getMonth() const year = this.maximalDate.getFullYear() return new Date(year + (month === 0 ? -1 : 0), month === 0 ? 11 : month - 1, 1) + + // // const date = new Date().setMonth(this.maximalDate.getMonth() - 1) + // console.log(new Date('Mon Jan 10 2022 16:32:58 GMT+0100')) + // const date = new Date('Mon Jan 10 2022 16:32:58 GMT+0100').setMonth(this.maximalDate.getMonth() - 1) + // // console.log(date.toISOString()) + // console.log(new Date(date.getFullYear(), date.getMonth(), 1)) + // return new Date(date.getFullYear(), date.getMonth(), 1) }, disabled() { return (