Refactored duplicated code into setMonth()
Added support for Home and End keys in month <input>