Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

261
Vistas
How to clear calendar input with java script

JavaScript function after clicking on clear button

function resetTime() {
    document.getElementById("to_time").valueAsDate = null;
}

PrimeFaces calendar tag

<p:calendar id="to_time"
            value="#{anomaliesList.toDate}"
            readonlyInput="true"
            maxdate="#{currentDate}"
            size="16"
            pattern="dd/MM/yyyy HH:mm" />
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First of all, p:calendar is deprecated. Use p:datePicker instead.

The easiest way to deal with this is setting a widgetVar on your p:datePicker. This allows you to use the client side API.

To reset a date, use:

PF('yourWidgetName').setDate(null);

Note that if you want to use getElementById you probably need to incorporate the form clientId.

See also:

  • How can I know the id of a JSF component so I can use in Javascript
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda