From 7107d510a5301f50ca5dc1bf9d4463ad99a33af8 Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Mon, 4 Oct 2021 20:06:28 -0700 Subject: [PATCH] Update schoolCalendar.js --- apps/schoolCalendar/schoolCalendar.js | 54 ++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/apps/schoolCalendar/schoolCalendar.js b/apps/schoolCalendar/schoolCalendar.js index a6537aa66..36f9110a7 100644 --- a/apps/schoolCalendar/schoolCalendar.js +++ b/apps/schoolCalendar/schoolCalendar.js @@ -1,4 +1,5 @@ require("Font8x12").add(Graphics); +require("Font8x16").add(Graphics); Graphics.prototype.setFontAudiowide = function () { var widths = atob("BxYfDBkYGhkZFRkZCA=="); @@ -131,7 +132,55 @@ function updateHoursToCurrentTime(currentHourFunction) { return currentHourUpdatedFunction; } - +function updateDay(ffunction,day){ + if(ffunction == 1){ + switch (day) { + case 0: + return "Sunday"; + case 1: + day = "Monday"; + break; + case 2: + day = "Tuesday"; + break; + case 3: + day = "Wednesday"; + break; + case 4: + day = "Thursday"; + break; + case 5: + day = "Friday"; + break; + case 6: + day = "Saturday"; + return day; +} + }else if(ffunction == 2){ + switch (day) { + case 0: + return "Sun"; + case 1: + day = "Mon"; + break; + case 2: + day = "Tue"; + break; + case 3: + day = "Wed"; + break; + case 4: + day = "Thu"; + break; + case 5: + day = "Fri"; + break; + case 6: + day = "Sat"; + return day; + } + } +} function RedRectDown() { if(currentPositionTable > 0){ @@ -197,8 +246,9 @@ function displayClock() { scheduleHourUpdatedEnd = updateHoursToCurrentTime(foundSchedule[((foundNumber-2)+currentPositionTable)].eh); g.setColor(255,255,255); g.reset(); - g.setFont("8x12"); + g.setFont("8x16"); g.drawString(foundSchedule[((foundNumber-2)+currentPositionTable)].cn,13,30); + g.drawString(scheduleHourUpdatedStart+":"+scheduleMinuteUpdatedStart+"-"+scheduleHourUpdatedEnd+":"+scheduleMinuteUpdatedEnd,13,50); } g.flip(); }