Skip to content

Instantly share code, notes, and snippets.

@thomasxbanks
Created June 15, 2017 16:02
Show Gist options
  • Select an option

  • Save thomasxbanks/8f6cad1570f928669a67165281a0b505 to your computer and use it in GitHub Desktop.

Select an option

Save thomasxbanks/8f6cad1570f928669a67165281a0b505 to your computer and use it in GitHub Desktop.
Calculate the copyright date from a start date and now.
let colophon = (startDate) => {
let now = new Date()
return (startDate < now.getFullYear()) ? startDate += " - " + now.getFullYear() : now.getFullYear()
}
document.querySelector('#colophon').innerText = colophon('2014')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment