From 3adbb95744817ecf1bd3801394acda192bf468d7 Mon Sep 17 00:00:00 2001 From: Sriram Hariharan Date: Sat, 12 Jan 2019 00:21:41 -0600 Subject: [PATCH] calendar hours and num courses count --- calendar.html | 10 +++++++--- js/calendar.js | 6 ++++++ js/content.js | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/calendar.html b/calendar.html index bc7f852d..18715b56 100644 --- a/calendar.html +++ b/calendar.html @@ -11,15 +11,19 @@
- diff --git a/js/calendar.js b/js/calendar.js index 1b1bd466..fe33680b 100644 --- a/js/calendar.js +++ b/js/calendar.js @@ -241,13 +241,19 @@ $(function () { function setAllEvents(savedCourses) { colorCounter = 0; classSchedules = []; + var hours = 0; for (let i = 0; i < savedCourses.length; i++) { + var classInfo = savedCourses[i]; + var course_nbr = classInfo.coursename.substring(classInfo.coursename.search(/\d/), classInfo.coursename.indexOf(" ", classInfo.coursename.search(/\d/))); + hours += parseInt(course_nbr.substring(course_nbr.search(/\d/), course_nbr.search(/\d/) + 1)); for (let j = 0; j < savedCourses[i].datetimearr.length; j++) { let session = savedCourses[i].datetimearr[j]; // One single session for a class setEventForSection(session, colorCounter, i); } colorCounter++; } + $("#hours").text(hours + " Hours"); + $("#num").text(savedCourses.length + " Courses"); } //create the event object for every section diff --git a/js/content.js b/js/content.js index a6f7dce1..c570677f 100644 --- a/js/content.js +++ b/js/content.js @@ -439,7 +439,7 @@ function getDistribution(sem) { /*Open the modal and show all the data*/ function openDialog(dep, cls, sem, professor, res) { - $("#myModal").fadeIn(100); + $("#myModal").fadeIn(fadetime); //initial text on the "save course button"