MCPcopy
hub / github.com/flatpickr/flatpickr / updateNavigationCurrentMonth

Function updateNavigationCurrentMonth

src/index.ts:2776–2811  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2774 }
2775
2776 function updateNavigationCurrentMonth() {
2777 if (self.config.noCalendar || self.isMobile || !self.monthNav) return;
2778
2779 self.yearElements.forEach((yearElement, i) => {
2780 const d = new Date(self.currentYear, self.currentMonth, 1);
2781 d.setMonth(self.currentMonth + i);
2782
2783 if (
2784 self.config.showMonths > 1 ||
2785 self.config.monthSelectorType === "static"
2786 ) {
2787 self.monthElements[i].textContent =
2788 monthToStr(
2789 d.getMonth(),
2790 self.config.shorthandCurrentMonth,
2791 self.l10n
2792 ) + " ";
2793 } else {
2794 self.monthsDropdownContainer.value = d.getMonth().toString();
2795 }
2796
2797 yearElement.value = d.getFullYear().toString();
2798 });
2799
2800 self._hidePrevMonthArrow =
2801 self.config.minDate !== undefined &&
2802 (self.currentYear === self.config.minDate.getFullYear()
2803 ? self.currentMonth <= self.config.minDate.getMonth()
2804 : self.currentYear < self.config.minDate.getFullYear());
2805
2806 self._hideNextMonthArrow =
2807 self.config.maxDate !== undefined &&
2808 (self.currentYear === self.config.maxDate.getFullYear()
2809 ? self.currentMonth + 1 > self.config.maxDate.getMonth()
2810 : self.currentYear > self.config.maxDate.getFullYear());
2811 }
2812
2813 function getDateStr(specificFormat?: string) {
2814 const format =

Callers 4

buildMonthNavFunction · 0.85
changeMonthFunction · 0.85
redrawFunction · 0.85
selectDateFunction · 0.85

Calls 1

monthToStrFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…