Add some comments for trying to fullfil Moriz suggestion

This commit is contained in:
Wolfgang Huß 2022-08-11 08:50:40 +02:00
parent 24c763c00f
commit 59f415bd0a
2 changed files with 9 additions and 2 deletions

View File

@ -73,7 +73,7 @@ describe('ContributionForm', () => {
})
})
describe('actual date', () => {
describe.only('actual date', () => {
describe('same month', () => {
beforeEach(async () => {
const now = new Date().toISOString()

View File

@ -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 (