Extend Data with getWeek().
This commit is contained in:
parent
1f0a671c5c
commit
9f528316e7
1 changed files with 6 additions and 0 deletions
|
@ -38,3 +38,9 @@ if (!window.console) {
|
|||
if (!console.log) {
|
||||
console.log = function(){}
|
||||
}
|
||||
|
||||
|
||||
Date.prototype.getWeek = function() {
|
||||
var onejan = new Date(this.getFullYear(),0,1);
|
||||
return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
|
||||
}
|
Loading…
Reference in a new issue