MCPcopy Create free account
hub / github.com/diffusionstudio/vits-web / getFirstWeekStartDate

Function getFirstWeekStartDate

src/piper.js:3974–3991  ·  view source on GitHub ↗
(janFourth)

Source from the content-addressed store, hash-verified

3972 return compare;
3973 }
3974 function getFirstWeekStartDate(janFourth) {
3975 switch (janFourth.getDay()) {
3976 case 0:
3977 return new Date(janFourth.getFullYear() - 1, 11, 29);
3978 case 1:
3979 return janFourth;
3980 case 2:
3981 return new Date(janFourth.getFullYear(), 0, 3);
3982 case 3:
3983 return new Date(janFourth.getFullYear(), 0, 2);
3984 case 4:
3985 return new Date(janFourth.getFullYear(), 0, 1);
3986 case 5:
3987 return new Date(janFourth.getFullYear() - 1, 11, 31);
3988 case 6:
3989 return new Date(janFourth.getFullYear() - 1, 11, 30);
3990 }
3991 }
3992 function getWeekBasedYear(date) {
3993 var thisDate = addDays(new Date(date.tm_year + 1900, 0, 1), date.tm_yday);
3994 var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4);

Callers 1

getWeekBasedYearFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected