school-schedule-sync
Version:
Synchronization between JSON schedule and Google Calendar
11 lines • 378 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFirstDay = getFirstDay;
function getFirstDay(weekDay, year) {
const startDate = new Date(year, 8, 1);
const startDay = startDate.getDay();
const diff = weekDay - startDay;
startDate.setDate((diff + 8) % 7 + 1);
return startDate;
}
//# sourceMappingURL=getFirstDay.js.map