I need to determine if today's date is the same as a specific date using moment.js.
const today = moment(new Date()).format('DD/MM/YYYY')
console.log(today) // "28/09/2021"
const expiry = moment(new Date('2021/09/28')).format('DD/MM/YYYY')
console.log(expiry) // "28/09/2021"
However, when I compare them, I am getting false.
console.log(moment(today).isSame(expiry)); // false
I also encountered this warning message in fiddle:
"Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info."
Arguments: