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

289
Views
MUI React, Minimum Date

How can I set Minimum Date, so the user can't pick To Date that is before From Date.
Here is my Two Date Pickers, using moment to format the date.

                                <DatePicker
                                    value={fromDate}
                                    label="From Date"
                                    color="primary"
                                    inputFormat="DD/MM/YYYY"
                                    onChange={(fromDateValue) =>
                                        setFromDate(moment(fromDateValue).format('DD-MMM-YYYY', moment.ISO_8601))
                                    }
                                    renderInput={(params) => <TextField {...params} size="small" margin="dense" sx={{ width: 238 }} />}
                                />

                                    <DatePicker
                                        value={toDate}
                                        label="To Date"
                                        color="primary"
                                        inputFormat="DD/MM/YYYY"
                                        onChange={(toDateValue) => setToDate(moment(toDateValue).format('DD-MMM-YYYY', moment.ISO_8601))}
                                        renderInput={(params) => (
                                            <TextField {...params} size="small" margin="dense" sx={{ width: 218 }} color="primary" />
                                        )}
                                    />
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the minDate prop:

Min selectable date.

You can add it to your second DatePicker, like:

minDate={fromDate}

(Working example)

about 4 years ago · Juan Pablo Isaza 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!