The year() function of the moment 'month' object only takes integers - passing it a string results in the month not changing when you select a new month.