Created
June 15, 2017 16:02
-
-
Save thomasxbanks/8f6cad1570f928669a67165281a0b505 to your computer and use it in GitHub Desktop.
Calculate the copyright date from a start date and now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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