Ustawienie zakresu dat za pomocą YUP w React Date Picker

const YourSettingSchema = Yup.object().shape({
  dateOfBirth: Yup.string()
    .nullable()
    .test('Date of Birth', 'Should be greather than 18', function(value) {
      return moment().diff(moment(value), 'years') >= 18;
    }),
});
Envious Eagle