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

233
Visualizações
How to limit the input in DateTime picker?

I am making a django app which is going to collect data from a form. In the form I'm gonna put some normal fields and a DateTime field, but I wanna limit that DateTime field so the user can only select:

  1. For the Date:

    • from today to lets say 1 year ahead
  2. For the Time:

    • from the current local time(so if the date is today, they won't be able to pick a time before the current local time)
    • afterwards every day from 10:00 until 21:00

Is there a way to do that? Thank You!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can do backend validation in django by using the model's clean method https://docs.djangoproject.com/en/3.2/ref/models/instances/#django.db.models.Model.clean

If you want a better user experience, you need to do that with javascript. The way you solve it there depends on the tool you use. (e.g. jquery Datepicker?) This validates the input before you submit the form to the server.

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