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

518
Views
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
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!