javascript check if two date are ugual
const isSameDate = (dateA, dateB) => {
return dateA.toISOString() === dateB.toISOString();
};
const r = isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 20));
console.log(r); //> true
javascript check if two date are ugual
const isSameDate = (dateA, dateB) => {
return dateA.toISOString() === dateB.toISOString();
};
const r = isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 20));
console.log(r); //> true
date compare in js
var x = new Date('2013-05-23');
var y = new Date('2013-05-23');
// less than, greater than is fine:
x < y; => false
x > y; => false
x === y; => false, oops!
// anything involving '=' should use the '+' prefix
// it will then compare the dates' millisecond values
+x <= +y; => true
+x >= +y; => true
+x === +y; => true
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us