Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

429
Views
Sí. Cómo cambiar la fecha del texto del mensaje de error

Cómo cambiar el texto del mensaje para el campo de fecha:

fecha debe ser un tipo de date , pero el valor final fue: Invalid Date

Ahora el esquema se ve así:

 let scheema= yup.object().shape({ date: yup.date() .min(MIN_DATE, `Дата не может быть раньше ${MIN_DATE?.toLocaleDateString('ru')}`) .max(MAX_DATE, `Дата не может быть позже ${MAX_DATE?.toLocaleDateString('ru')}`) .required('Обязательное поле'), reason: yup.string().required('Обязательное поле'), comment: yup.string().max(4000, 'Превышено количество символов'), });

el error es:

 { "date": "date must be a `date` type, but the final value was: `Invalid Date`." }

necesito cambiar este texto

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Podrías usar Schema.typeError de la siguiente manera:

 date: yup.date() .typeError('Expected a value of type ${type} but got: ${value}') // ex: Expected a value of type date but got: Invalid Date .min(MIN_DATE, `Дата не может быть раньше ${MIN_DATE?.toLocaleDateString('ru')}`) .max(MAX_DATE, `Дата не может быть позже ${MAX_DATE?.toLocaleDateString('ru')}`) .required('Обязательное поле'), reason: yup.string().required('Обязательное поле'), comment: yup.string().max(4000, 'Превышено количество символов'),
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!