scrimba
Practical math
Weekly Schedule - Using Date() to Build Week / Generating Tasks
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Weekly Schedule - Using Date() to Build Week / Generating Tasks
AboutCommentsNotes
Weekly Schedule - Using Date() to Build Week / Generating Tasks
Expand for more info
index.js
run
preview
console
function roll(min, max, floatFlag) {
let r = Math.random() * (max - min) + min
return floatFlag ? r : Math.floor(r)
}

let weekdays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
let firstDay = new Date("3/1/2020")

// Write a getNextDay Function
// Takes in a Date object and
// returns the following day
function getNextDay(day) {

}

// Generate a list of random tasks,
// names can simply be "Task 54"/"Task 23"/etc
// Must have index and Boolean to check for completion
function generateTasks() {

}

// Returns an array of days representing the week
// Generate Tasks for each day
function buildWeek(day) {

}




let week = buildWeek(firstDay)










// let schedule = document.getElementById("WeeklySchedule")
// let scheduleHtml = week.reduce((accum, day) => {
// return accum + `<div class="day">
// <div>${weekdays[day.date.getDay()]}</div>
// ${tasksToHtml(day.tasks)}
// </div>`
// }, '')
// function tasksToHtml(tasks) {
// return tasks.reduce((accumulator, task) => {
// return accumulator + `
// <div class="circle-container ${task.complete ? 'checked' : ''}">
// <div class="circle"></div>
// <label>${task.name}</label>
// </div>
// `
// }, '')
// }
// schedule.innerHTML = scheduleHtml
Console
/index.html
-3:58