|
359 | 359 | year: date.getFullYear()
|
360 | 360 | }
|
361 | 361 | ];
|
362 |
| - // if (this.options.mainCalendar === 'right') { |
363 |
| - // this.calendars[0].month += 1 - this.options.numberOfMonths; |
364 |
| - // } |
365 | 362 | }
|
366 | 363 |
|
367 | 364 | this.adjustCalendars();
|
368 | 365 | }
|
369 | 366 |
|
370 | 367 | adjustCalendars() {
|
371 | 368 | this.calendars[0] = this.adjustCalendar(this.calendars[0]);
|
372 |
| - // for (let c = 1; c < this.options.numberOfMonths; c++) { |
373 |
| - // this.calendars[c] = this.adjustCalendar({ |
374 |
| - // month: this.calendars[0].month + c, |
375 |
| - // year: this.calendars[0].year |
376 |
| - // }); |
377 |
| - // } |
378 | 369 | this.draw();
|
379 | 370 | }
|
380 | 371 |
|
|
521 | 512 | arr.push('is-endrange');
|
522 | 513 | }
|
523 | 514 | return (
|
524 |
| - '<td data-day="' + |
525 |
| - opts.day + |
526 |
| - '" class="' + |
527 |
| - arr.join(' ') + |
528 |
| - '" aria-selected="' + |
529 |
| - ariaSelected + |
530 |
| - '">' + |
531 |
| - '<button class="datepicker-day-button" type="button" ' + |
532 |
| - 'data-year="' + |
533 |
| - opts.year + |
534 |
| - '" data-month="' + |
535 |
| - opts.month + |
536 |
| - '" data-day="' + |
537 |
| - opts.day + |
538 |
| - '">' + |
539 |
| - opts.day + |
540 |
| - '</button>' + |
| 515 | + `<td data-day="${opts.day}" class="${arr.join(' ')}" aria-selected="${ariaSelected}">` + |
| 516 | + `<button class="datepicker-day-button" type="button" data-year="${opts.year}" data-month="${ |
| 517 | + opts.month |
| 518 | + }" data-day="${opts.day}">${opts.day}</button>` + |
541 | 519 | '</td>'
|
542 | 520 | );
|
543 | 521 | }
|
|
568 | 546 | arr = [];
|
569 | 547 | for (i = 0; i < 7; i++) {
|
570 | 548 | arr.push(
|
571 |
| - '<th scope="col"><abbr title="' + |
572 |
| - this.renderDayName(opts, i) + |
573 |
| - '">' + |
574 |
| - this.renderDayName(opts, i, true) + |
575 |
| - '</abbr></th>' |
| 549 | + `<th scope="col"><abbr title="${this.renderDayName(opts, i)}">${this.renderDayName( |
| 550 | + opts, |
| 551 | + i, |
| 552 | + true |
| 553 | + )}</abbr></th>` |
576 | 554 | );
|
577 | 555 | }
|
578 | 556 | return '<thead><tr>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</tr></thead>';
|
|
628 | 606 |
|
629 | 607 | for (arr = []; i < j && i <= opts.maxYear; i++) {
|
630 | 608 | if (i >= opts.minYear) {
|
631 |
| - arr.push( |
632 |
| - '<option value="' + |
633 |
| - i + |
634 |
| - '"' + |
635 |
| - (i === year ? ' selected="selected"' : '') + |
636 |
| - '>' + |
637 |
| - i + |
638 |
| - '</option>' |
639 |
| - ); |
| 609 | + arr.push(`<option value="${i}" ${i === year ? 'selected="selected"' : ''}>${i}</option>`); |
640 | 610 | }
|
641 | 611 | }
|
642 | 612 |
|
643 |
| - yearHtml = |
644 |
| - '<select class="datepicker-select orig-select-year" tabindex="-1">' + |
645 |
| - arr.join('') + |
646 |
| - '</select>'; |
| 613 | + yearHtml = `<select class="datepicker-select orig-select-year" tabindex="-1">${arr.join( |
| 614 | + '' |
| 615 | + )}</select>`; |
647 | 616 |
|
648 | 617 | let leftArrow =
|
649 | 618 | '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg>';
|
650 |
| - html += |
651 |
| - '<button class="month-prev' + |
652 |
| - (prev ? '' : ' is-disabled') + |
653 |
| - '" type="button">' + |
654 |
| - leftArrow + |
655 |
| - '</button>'; |
| 619 | + html += `<button class="month-prev${ |
| 620 | + prev ? '' : ' is-disabled' |
| 621 | + }" type="button">${leftArrow}</button>`; |
656 | 622 |
|
657 | 623 | html += '<div class="selects-container">';
|
658 | 624 | if (opts.showMonthAfterYear) {
|
|
670 | 636 | next = false;
|
671 | 637 | }
|
672 | 638 |
|
673 |
| - // if (c === (this.options.numberOfMonths - 1) ) { |
674 | 639 | let rightArrow =
|
675 | 640 | '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg>';
|
676 |
| - html += |
677 |
| - '<button class="month-next' + |
678 |
| - (next ? '' : ' is-disabled') + |
679 |
| - '" type="button">' + |
680 |
| - rightArrow + |
681 |
| - '</button>'; |
682 |
| - // } |
| 641 | + html += `<button class="month-next${ |
| 642 | + next ? '' : ' is-disabled' |
| 643 | + }" type="button">${rightArrow}</button>`; |
683 | 644 |
|
684 | 645 | return (html += '</div>');
|
685 | 646 | }
|
|
933 | 894 | if (Datepicker._isDate(date)) {
|
934 | 895 | this.setDate(date);
|
935 | 896 | }
|
936 |
| - // if (!self._v) { |
937 |
| - // self.show(); |
938 |
| - // } |
939 | 897 | }
|
940 | 898 |
|
941 | 899 | renderDayName(opts, day, abbr) {
|
|
0 commit comments