I have a basic requirement of end date should be greater than start date. I'm using yup schema for error handling for my react application.
const validateSchema = Yup.object().shape({
startDate: Yup.date()
.default(() => new Date())
.typeError("Please Enter valid Date Format")
.required("Field is Mandatory"),
endDate: Yup.date()
.default(() => new Date())
.typeError("Please Enter valid Date Format")
.required("Field is Mandatory")
.min(Yup.ref("startDate"), "Minimum Date"),
});
sandbbox link: Sandbox link
yup.ref is not working inside the yup.date().min
May 1, 2024
1 minute
It seems like this feed has limited content. Do you want to fetch full content?
FetchUnfortunately, we're not able to fetch full content in this moment,
Do you want to check full content in the source blog?
Author: DEV
Date: May 1, 2024
Permalink: owlver.com/s/xbvWjanE
A story from Owlver Network.
Last Stories
- Vector Search pt. 2 - Vision Algorithms 🎑
- Welcome Thread - v277
- Get more comfortable with IntersectionObserver 🚦👀
- Maintaining Session Data Across Page Redirects: A Comprehensive Guide
- Basic painting with Ruby: implementing a flood-fill algorithm with DragonRuby GTK
- Game Development Diary #2
- 🧿 Owlver Network © 2020-2024
- Blog
- Accessibility
- Terms of Services
- Privacy Policy
- Cookies Policy
- Manifest
- Disclaimer
- Assets
- Careers
- Developers
- Help Center
- FAQ
- Status
- About
- Sitemap
- Contact
What's your thoughts?
Please Register or Login to your account to be able to submit your comment.