script.js
// Display colors based on time of activities 
Display colors based on time of activities
Display colors based on time of activities
function timeColorDisplay(time) {
  console.log(time)
  let timeValues = Number(time.data('hour'));
  let currentTime = moment().format("HH")
  currentTime = currentTime + "00"
  console.log(timeValues)
  console.log(currentTime)
  console.log(timeValues < currentTime)
  if (timeValues < currentTime) {
    time.addClass("past");
} else if (timeValues > currentTime) {
    time.addClass("future");
} else {
    time.addClass("present");
}}
function timeColorDisplay ( time ) { console . log ( time ) let timeValues = Number ( time . data ( 'hour' ) ) ; let currentTime = moment ( ) . format ( "HH" ) currentTime = currentTime + "00" console . log ( timeValues ) console . log ( currentTime ) console . log ( timeValues < currentTime ) if ( timeValues < currentTime ) { time . addClass ( "past" ) ; } else if ( timeValues > currentTime ) { time . addClass ( "future" ) ; } else { time . addClass ( "present" ) ; } }
Display colors based on time of activities
Display colors based on time of activities
// Gather all the elements that contain data-hour attribute