MCPcopy
hub / github.com/flatpickr/flatpickr / onMonthNavClick

Function onMonthNavClick

src/index.ts:2853–2869  ·  view source on GitHub ↗
(e: MouseEvent)

Source from the content-addressed store, hash-verified

2851 }
2852
2853 function onMonthNavClick(e: MouseEvent) {
2854 const eventTarget = getEventTarget(e);
2855 const isPrevMonth = self.prevMonthNav.contains(eventTarget as Node);
2856 const isNextMonth = self.nextMonthNav.contains(eventTarget as Node);
2857
2858 if (isPrevMonth || isNextMonth) {
2859 changeMonth(isPrevMonth ? -1 : 1);
2860 } else if (
2861 self.yearElements.indexOf(eventTarget as HTMLInputElement) >= 0
2862 ) {
2863 (eventTarget as HTMLInputElement).select();
2864 } else if ((eventTarget as Element).classList.contains("arrowUp")) {
2865 self.changeYear(self.currentYear + 1);
2866 } else if ((eventTarget as Element).classList.contains("arrowDown")) {
2867 self.changeYear(self.currentYear - 1);
2868 }
2869 }
2870
2871 function timeWrapper(
2872 e: MouseEvent | KeyboardEvent | FocusEvent | IncrementEvent

Callers

nothing calls this directly

Calls 2

getEventTargetFunction · 0.90
changeMonthFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…