MCPcopy
hub / github.com/flatpickr/flatpickr / build

Function build

src/index.ts:574–677  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

572 }
573
574 function build() {
575 const fragment = window.document.createDocumentFragment();
576 self.calendarContainer = createElement<HTMLDivElement>(
577 "div",
578 "flatpickr-calendar"
579 );
580 self.calendarContainer.tabIndex = -1;
581
582 if (!self.config.noCalendar) {
583 fragment.appendChild(buildMonthNav());
584 self.innerContainer = createElement<HTMLDivElement>(
585 "div",
586 "flatpickr-innerContainer"
587 );
588
589 if (self.config.weekNumbers) {
590 const { weekWrapper, weekNumbers } = buildWeeks();
591 self.innerContainer.appendChild(weekWrapper);
592 self.weekNumbers = weekNumbers;
593 self.weekWrapper = weekWrapper;
594 }
595
596 self.rContainer = createElement<HTMLDivElement>(
597 "div",
598 "flatpickr-rContainer"
599 );
600 self.rContainer.appendChild(buildWeekdays());
601
602 if (!self.daysContainer) {
603 self.daysContainer = createElement<HTMLDivElement>(
604 "div",
605 "flatpickr-days"
606 );
607 self.daysContainer.tabIndex = -1;
608 }
609
610 buildDays();
611
612 self.rContainer.appendChild(self.daysContainer);
613 self.innerContainer.appendChild(self.rContainer);
614 fragment.appendChild(self.innerContainer);
615 }
616
617 if (self.config.enableTime) {
618 fragment.appendChild(buildTime());
619 }
620
621 toggleClass(
622 self.calendarContainer,
623 "rangeMode",
624 self.config.mode === "range"
625 );
626
627 toggleClass(
628 self.calendarContainer,
629 "animate",
630 self.config.animate === true
631 );

Callers 1

initFunction · 0.70

Calls 7

createElementFunction · 0.90
toggleClassFunction · 0.90
buildMonthNavFunction · 0.85
buildWeeksFunction · 0.85
buildWeekdaysFunction · 0.85
buildDaysFunction · 0.85
buildTimeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…