Last active
May 11, 2016 23:12
-
-
Save Der-Eddy/b040c37ebf013f4ce98d9207a0933f2f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Date.prototype.getWeekNumber = function(){ | |
var d = new Date(+this); | |
d.setHours(0,0,0); | |
d.setDate(d.getDate()+4-(d.getDay()||7)); | |
return Math.ceil((((d-new Date(d.getFullYear(),0,1))/8.64e7)+1)/7); | |
}; | |
Array.prototype.mapProperty = function(property) { | |
return this.map(function (obj) { | |
return obj[property]; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment