Skip to content

Instantly share code, notes, and snippets.

@scolton99
Created October 11, 2022 17:27
Show Gist options
  • Save scolton99/ecad83cbb67f3bb1c63812ed99a40892 to your computer and use it in GitHub Desktop.
Save scolton99/ecad83cbb67f3bb1c63812ed99a40892 to your computer and use it in GitHub Desktop.
Create headings for the "What did you work on today?" Confluence documents.
const generateHeadings = () => {
let date = new Date('2023-08-31T00:00:00');
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
for (; date.getTime() >= Date.parse('2023-06-01T00:00:00'); date.setDate(date.getDate() - 1)) {
if (date.getDay() === 0 || date.getDay() === 6)
continue;
const dateStr = date.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });
console.log(`# ${dateStr}\n* \n`);
}
};
generateHeadings();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment