Difference between revisions of "DOM Calendar"

From ProgZoo
Jump to navigation Jump to search
Line 1: Line 1:
<pre id='shellbody' data-qtp='DOM'></pre>
==Display dates as specified==
==Display dates as specified==
<div class=qu data-width=300>
<div class=qu data-width=300>

Revision as of 21:26, 1 January 2022


Display dates as specified

  • Show today's date, day of the week.
let today = new Date();
document.body.innerHTML = `
${today.toLocaleDateString('en',{weekday:'long'})} <br>
${today.toLocaleDateString('en',{weekday:'long'})} <br>
`;
let today = new Date();
document.body.innerHTML = `
${today.toLocaleDateString('en',{weekday:'long'})} <br>
${today.toLocaleDateString('en',{month:'long'})} <br>
${today.toLocaleDateString('fr',{weekday:'long'})} <br>
${today.toLocaleDateString('fr',{month:'long'})} <br>
`;