Checks if the first date is before the second date.
The first date.
The second date to compare.
true if date1 is before date2.
true
date1
date2
isBefore(new Date('2025-01-01'), new Date('2025-01-02')); // true Copy
isBefore(new Date('2025-01-01'), new Date('2025-01-02')); // true
Checks if the first date is before the second date.