Created
December 28, 2017 12:42
-
-
Save enricopolanski/2726f4b3beae89a028423113eb51f948 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function InitPlan() { | |
// gets the date of monday of the current week | |
this.startingWeek = function() { | |
let now = new Date(); | |
now.setDate(now.getDate() - now.getDay() + 1); | |
return (now.getDate() + "-" + (now.getMonth() + 1) + "-" + now.getFullYear()); | |
}(); | |
this.weeks = { | |
"0": { | |
"mon": [], | |
"tue": [], | |
"wed": [], | |
"thu": [], | |
"fri": [], | |
"sat": [], | |
"sun": [] | |
} | |
}; | |
this.topics = {}; | |
this.addTopic = function(topic) { | |
// checks if topic exists | |
if (topic in this.topics) { | |
console.log("This topic already exists!"); | |
return; | |
} else { | |
this.topics = topic; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment