Created
January 13, 2016 08:42
-
-
Save karenpeng/362e5b4e4319d8238c7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var d = Date.prototype; | |
Object.defineProperty(d, "year", { | |
get: function() {return this.getFullYear() }, | |
set: function(y) { this.setFullYear(y) } | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment