diff --git a/frontend/src/components/Contributions/ContributionForm.vue b/frontend/src/components/Contributions/ContributionForm.vue index 3098a4dd1..5c00cd54a 100644 --- a/frontend/src/components/Contributions/ContributionForm.vue +++ b/frontend/src/components/Contributions/ContributionForm.vue @@ -119,13 +119,13 @@ const { hours: props.modelValue.hours, amount: props.modelValue.amount, }, - validationSchema + validationSchema, }) const { meta: dataFieldMeta } = useField('date') const updateField = (newValue, name) => { - if(typeof name === 'string' && name.length) { + if (typeof name === 'string' && name.length) { setFieldValue(name, newValue) } } @@ -173,7 +173,7 @@ watch( () => formValues.hours, () => { updateAmount(formValues.hours) - } + }, ) function updateAmount(hours) { diff --git a/frontend/src/components/Inputs/ValidatedInput.vue b/frontend/src/components/Inputs/ValidatedInput.vue index 305f4b8f3..9be51b9c1 100644 --- a/frontend/src/components/Inputs/ValidatedInput.vue +++ b/frontend/src/components/Inputs/ValidatedInput.vue @@ -19,10 +19,10 @@ \ No newline at end of file + diff --git a/frontend/src/validationSchemas.js b/frontend/src/validationSchemas.js index 6aa614f67..ae09a16a8 100644 --- a/frontend/src/validationSchemas.js +++ b/frontend/src/validationSchemas.js @@ -1,15 +1,14 @@ -import {object, string, date } from 'yup' +import { object, string, date } from 'yup' export const createContributionFormValidation = (t) => { return object({ // The date field is required and needs to be a valid date // contribution date - date: - date() + date: date() .required(t('contribution.noDateSelected')) - .min((new Date(new Date().setMonth(new Date().getMonth() - 1, 1))).toISOString().slice(0,10)) // min date is first day of last month - .max(new Date().toISOString().slice(0,10)) + .min(new Date(new Date().setMonth(new Date().getMonth() - 1, 1)).toISOString().slice(0, 10)) // min date is first day of last month + .max(new Date().toISOString().slice(0, 10)) .default(''), // date cannot be in the future - memo: string().required(t('')).min(5).max(255) + memo: string().required(t('')).min(5).max(255), }) }