CS-Forms - Java for flatpickr

Hi there, for the flatpickr calendar, I created a custom Javascript that loads the year input field as a dropdown.

How can i place the script inside my calendar only instead of the whole site JavaScript? Basically that it only runs when the calendar opens.

Thanks!