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

519
Vistas
html2canvas - Can you change the time format?

I'm using html2canvas to print my page, which contains <input type="time"> elements. I would like them to print in the displayed 12-hour format including the AM/PM text. From what I've read about time inputs, the browser handles the displayed time format automatically and you can't actually set it anywhere in the element itself. Is there any way I can tell html2canvas to take the displayed time format and not the 24-hour format?

My page:

Expected 12-hour time format

html2canvas result:

html2canvas result

html2canvas JS:

html2canvas(document.querySelector("#main"), {scale: 3}).then(canvas => {
        document.body.appendChild(canvas)
    }).then(() => {
        let canvas = document.querySelector('canvas');
        canvas.style.display = 'none';
        let image = canvas.toDataURL("image/png");
        let tWindow = window.open("");
        $(tWindow.document.body)
            .html("<img id='Image' src=" + image + " style='width:100%; height:auto;'></img>")
            .ready(function () {
                tWindow.focus();
                tWindow.print();
            });
about 4 years ago · Juan Pablo Isaza
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