I would like to know how to compare any two different date strings in javascript.
Two Date Strings, d1 and d2 are always in the format , dd mmm yyyy
and yyyy-mm-dd
How to compare datestring whether is same or not in javascript Below datestring is example,
var d1 = "12 Feb 1990"
var d2 = "1990-02-12"
if(d1.split(' ').[1] === new Date().toLocaleString('en-US', {month: 'short'})){
return true;
}
else {
return false
}