question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Localization of date in header/footer

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.3.0
  • Platform / OS version: Windows 10
  • URLs (if applicable): …
  • Node.js version: 9.11.1

What steps will reproduce the problem? Using date in header/footer.

Please include code that reproduces the issue. await page.pdf({ //.. displayHeaderFooter: true, headerTemplate: '<p></p>', footerTemplate: '<span class="date"></span>', margin: { bottom: '60px' } });

What is the expected result? 18-04-2018

What happens instead? 4/18/2018

Or simply put… I’m located in The Netherlands where date’s are normally formatted like dd-MM-yyyy. Is it possible to get some kind of localization in the header/footer?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
Sjonnie2ndcommented, Apr 18, 2018

@yrshaikh Hmm… Strangely for a moment I was looking at the templates as being some static kind of thing in stead of being programmable. Sometimes you get blind for something and hold on to it. Thanks for the input. I’ll close the issue.

0reactions
Pankajtanwarbannacommented, Jul 21, 2021

Later, I stored the value in a variable first, and then used ${print_this_date} instead of ${new Date().toDateString()}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Localization of date in header/footer · Issue #2408 - GitHub
I'm located in The Netherlands where date's are normally formatted like dd-MM-yyyy. Is it possible to get some kind of localization in the...
Read more >
Insert the date or time in a header or footer - Microsoft Support
Insert the current date in the header or footer · On the View menu, click Header and Footer. · Click the Print Settings...
Read more >
22183 – Cannot change date format in header/footer
When inserting a date field in either the header or footer of a spreadsheet, the default OOo format MM/DD/YYYY is used. No regard...
Read more >
Date format from header/footer token - MuseScore
Do we have any control of how the date is formatted when we use the '$D' ... Do you mean the locale as...
Read more >
How to insert current date and time in Excel cell/header/footer?
Then the current date and time are inserted in header/footer. ... B: Select the location you want to place the inserted information.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found