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

222
Views
React html date picker change date label

enter image description here

When I capture the selected date to a variable it displays like this "YYYY-MM-DD" But in the HTML date picker "MM/DD/YYYY"

All I want is to change that label to "YYYY-MM-DD" from "MM/DD/YYYY". I hope there should be a way to do this in JS with React instead of using another date picker library. How do I do this in React?

Codesandbox

Updated HTML date picker (input type date) display date label like this "MM/DD/YYYY" I do want to change it to display like "YYYY-MM-DD" in the input element

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

<div className="flex flex-col items-start max-w-sm">
  <label>A single "datetime" input</label>
  <DatePicker defaultValue={new Date()} includeTime />
  <br />

  <label>Paired picker and dropdown</label>
  <div className="flex space-x-2 w-full">
    <DatePicker
      defaultValue={new Date()}
      className="w-3/5"
    />
    <DropdownList
      data={getTimeList()}
      textField="label"
      className="w-2/5 mt-0"
    />
  </div>
  <br />
  <label>Paired picker and experimental time input</label>
  <div className="flex space-x-2 w-full">
    <DatePicker
      defaultValue={new Date()}
      className="w-3/5"
    />
    <TimeInput
      defaultValue={new Date()}
      className="w-2/5 mt-0"
      use12HourClock
    />
  </div>
</div>;
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!