@@ -210,8 +210,9 @@ function updateText() {
210210 case SCHOOL_IN_CLASS_OUT_FLAG :
211211
212212
213- document . getElementById ( "nextClass" ) . innerHTML = getClassName ( currentClassPeriodIndex + 1 )
214- document . getElementById ( "currentClass" ) . innerHTML = getClassName ( currentClassPeriodIndex )
213+ document . getElementById ( "nextClass" ) . innerHTML = getClassName ( getMostRecentlyStartedClassIndex ( ) + 1 )
214+ document . getElementById ( "currentClass" ) . innerHTML = schools [ selectedSchoolIndex ] . passingPeriodName
215+ document . getElementById ( 'timeToEndOfClass' ) . innerHTML = getTimeStringFromObject ( getTimeTo ( schools [ selectedSchoolIndex ] . schedules [ currentScheduleIndex ] . classes [ getMostRecentlyStartedClassIndex ( ) + 1 ] . startTime ) ) ;
215216 break ;
216217
217218 case CLASS_IN_SESSION_FLAG :
@@ -512,7 +513,7 @@ function convertMillisecondsToTime(milliseconds) {
512513 */
513514function getTimeToEndOfCurrentClassString ( ) {
514515 if ( classIsInSession ( ) ) {
515- return getTimeStringFromObject ( getTimeDelta ( getCurrentTimeObject ( ) , schools [ selectedSchoolIndex ] . schedules [ currentScheduleIndex ] . classes [ currentClassPeriodIndex ] . endTime ) ) ;
516+ return getTimeStringFromObject ( getTimeTo ( schools [ selectedSchoolIndex ] . schedules [ currentScheduleIndex ] . classes [ currentClassPeriodIndex ] . endTime ) ) ;
516517 } else {
517518 return "No Class"
518519 }
@@ -524,12 +525,17 @@ function getTimeToEndOfCurrentClassString() {
524525 */
525526function getTimeToStartOfSchoolString ( ) {
526527 if ( ! classIsInSession ( ) && ! isNoSchoolDay ( ) && compareTimes ( getCurrentTimeObject ( ) , schools [ selectedSchoolIndex ] . schedules [ currentScheduleIndex ] . classes [ 0 ] . startTime ) == - 1 ) {
527- return getTimeStringFromObject ( getTimeDelta ( getCurrentTimeObject ( ) , schools [ selectedSchoolIndex ] . schedules [ currentScheduleIndex ] . classes [ 0 ] . startTime ) ) ;
528+ return getTimeStringFromObject ( getTimeTo ( schools [ selectedSchoolIndex ] . schedules [ currentScheduleIndex ] . classes [ 0 ] . startTime ) ) ;
528529 } else {
529530 return "No Class"
530531 }
531532}
532533
534+
535+ function getTimeTo ( timeObject ) {
536+ return getTimeDelta ( getCurrentTimeObject ( ) , timeObject )
537+ }
538+
533539/**
534540 * this is a an unused method that was written for a feature that never got implemented and, as of this point in time, identical to @function getTimeToEndOfCurrentClassString()
535541 *
0 commit comments