Skip to content

Commit 03e68ab

Browse files
Merge pull request #618 from creativecommons/adjust-year-range
expand valid year range to `currentYear + 5` in Attribution Details
2 parents d21416e + 270674a commit 03e68ab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
![GitHub Repo stars](https://img.shields.io/github/stars/creativecommons/chooser?style=social)
66
![GitHub forks](https://img.shields.io/github/forks/creativecommons/chooser?style=social)
77

8-
# Chooser - v1.2
8+
# Chooser - v1.3
99

1010

1111
The Creative Commons License Chooser is meant to help people learn about CC licenses, and select the license that best fits their needs. The new version in this repo places greater importance on usability, and an educational experience of the six CC licenses.

src/scripts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ function isValidYear(year) {
587587
if (!yearPattern.test(year)) return false;
588588
const yearNum = parseInt(year, 10);
589589
const currentYear = new Date().getFullYear();
590-
return yearNum >= 1000 && yearNum <= currentYear;
590+
return yearNum >= 1000 && yearNum <= currentYear + 5;
591591
}
592592

593593
// Displays error message below input field
@@ -636,7 +636,7 @@ function validateInput(input) {
636636
case 'work-creation-year':
637637
if (!isValidYear(value)) {
638638
const currentYear = new Date().getFullYear();
639-
showError(input, `Please enter a valid 4-digit year between 1000 and ${currentYear} (e.g., ${currentYear})`);
639+
showError(input, `Please enter a valid 4-digit year between 1000 and ${currentYear + 5} (e.g., ${currentYear})`);
640640
return false;
641641
}
642642
break;

0 commit comments

Comments
 (0)