Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added yearSuffix to visually support different types of calendars #212

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions pikaday.js
Expand Up @@ -218,6 +218,9 @@
// Additional text to append to the year in the calendar title
yearSuffix: '',

// Visual offset to support different types of calendars
yearOffset: 0,

// Render the month after year in the calendar title
showMonthAfterYear: false,

Expand Down Expand Up @@ -342,10 +345,10 @@

for (arr = []; i < j && i <= opts.maxYear; i++) {
if (i >= opts.minYear) {
arr.push('<option value="' + i + '"' + (i === year ? ' selected': '') + '>' + (i) + '</option>');
arr.push('<option value="' + i + '"' + (i === year ? ' selected': '') + '>' + (i + opts.yearOffset) + '</option>');
}
}
yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year">' + arr.join('') + '</select></div>';
yearHtml = '<div class="pika-label">' + (year + opts.yearOffset) + opts.yearSuffix + '<select class="pika-select pika-select-year">' + arr.join('') + '</select></div>';

if (opts.showMonthAfterYear) {
html += yearHtml + monthHtml;
Expand Down