compara-datas
HTML
<input type="date" id="inicio">
<input type="date" id="fim">
<input type="button" value="Clique" id="btn">
JavaScript
window.onload = function () {
var d1 = document.getElementById('inicio').valueAsDate
var d2 = document.getElementById('fim').valueAsDate
var agora = new Date()
console.log(agora)
var btn = document.getElementById('btn')
btn.addEventListener('click', function checkTime() {
if(agora > d2) {
console.log('Turma finalizada.')
} else
console.log('Turma em andamento.')
})
}