In addition to the excellent direction from BrowserUK above, I would additionally direct you to the node on this site where thunders posted this code originally here. The main thing which has caught you in this instance is the usage of the literal terms 'year', 'month' and alike for returning the corresponding values.