Use Date.prototype.toISOString() and strict equality checking (===) to check if the first date is the same as the second one.
Time & Date
Use new Date(), setting the date to February 29th of the given year. Use Date.prototype.getMonth() to check if the month is equal to 1.
Use Date.prototype.getDay() to check weekend by using a modulo operator (%).
Here’s a trick for getting back a formatted month name (like January or Jan).
Here’s a way to get the date for the next occurrence of a specific day of the week.
Use the greater than operator (>) to check if the first date comes after the second one.
Use the less than operator (<) to check if the first date comes before the second one.
Use the greater than (>) and less than (<) operators to check if date is between dateStart and dateEnd.
Here is a vanilla JS alternative to the moment.js timeFromNow() method.