The Year Picker Custom Input Extension is based on an example referenced in this blog post. The concept is simple – sometimes you do not want to ask the user for a complete date, rather you want to select a year. There are many ways of achieving this goal, including plenty that do not need any custom JavaScript at all (you could, for example, create a Value List or a Screen Control List of Values that contain all of the necessary years, and ask the user to scroll through them. That is perfectly fine, if you just want to select a year.
But if you want the user to select a year, and to record a specific date in that year (for example, if the user selects 2022, then you want to save the information as 1st January 2022) then the problem is different – you no longer can rely on an attribute of type number or text, because you need to record a date. The idea for a Year Picker Custom Input Extension came from that example proposed by a reader of this website.
This example uses a jQuery add-in called, logically enough, year-select.js. The custom input extension code has plenty of comments for you to see what is happening in the Debugger to help you learn how custom input extensions work.
