JSFiddle - React, Tailwind, and code Playground

by stevejpurves

JavaScript

var timeRegex = /^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;
var start = "00:00"
var end = "10:00"
var pause = "02:00"

if(start.match(timeRegex) && end.match(timeRegex) &&    pause.match(timeRegex))
{   
  alert('win');
}
else
{   alert('fail');
}