UNPKG

360 BJavaScriptView Raw
1export default (function (o, c) {
2 var proto = c.prototype;
3
4 proto.weekYear = function () {
5 var month = this.month();
6 var weekOfYear = this.week();
7 var year = this.year();
8
9 if (weekOfYear === 1 && month === 11) {
10 return year + 1;
11 }
12
13 if (month === 0 && weekOfYear >= 52) {
14 return year - 1;
15 }
16
17 return year;
18 };
19});
\No newline at end of file