Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/resources/library/dayjs/plugins/weekyear.js
12923 views
1
export default (o, c) => {
2
const proto = c.prototype;
3
proto.weekYear = function () {
4
const month = this.month();
5
const weekOfYear = this.week();
6
const year = this.year();
7
if (weekOfYear === 1 && month === 11) {
8
return year + 1;
9
}
10
if (month === 0 && weekOfYear >= 52) {
11
return year - 1;
12
}
13
return year;
14
};
15
};
16
17