https://bobbyhadz.com/blog/javascript-compare-two-time-strings
const time1 = '07:30:24';
const time2 = '10:45:33';
if (time1 > time2) {
console.log('time1 is greater than time2');
} else if (time2 > time1) {
// ✅ this runs
console.log('time2 is greater than time1');
} else {
console.log('time1 is equal to time2');
}
沒有留言:
張貼留言