We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const today = moment().format('MM-DD-YYYY') const yesterday = moment().format('MM-DD-YYYY') moment(today).isSame(yesterday) // Chrome: true, Safari: false const today = moment() const yesterday = moment() moment(today).isSame(yesterday) // Chrome: true, Safari: true
The text was updated successfully, but these errors were encountered:
It seems that is because the .format('MM-DD-YYYY') does not comply RFC2822 nor ISO 8601 formats (https://momentjs.com/docs/#/parsing/string/).
.format('MM-DD-YYYY')
For example, with ISO 8601 format:
const today = moment().format('YYYY-MM-DD'); const yesterday = moment().format('YYYY-MM-DD'); const result = moment(today).isSame(yesterday); console.log(result); // Chrome: true, Safari: true, Firefox: true
With any other format, the format should be set when creating the moment objects (https://momentjs.com/docs/#/parsing/string-format/):
const today = moment().format('MM-DD-YYYY'); const yesterday = moment().format('MM-DD-YYYY'); const result = console.log(moment(today, 'MM-DD-YYYY').isSame(moment(yesterday, 'MM-DD-YYYY'))); console.log(result); // Chrome: true, Safari: true, Firefox: true
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: