Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

224
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda