Yeah, I was thinking about this, probably a good idea to go full parser on this.  Also, you've been doing javascript too long (year.length === 4).