You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functiontest(format){returnmoment(moment().format(format)).isValid();}test('YYYY');// returns true, no warningtest('hamster');// returns false, and issues warning
Expected behavior
return false without warning.
Screenshots
If applicable, add screenshots to help explain your problem.
Moment-specific environment
The time zone setting of the machine the code is running on: GMT+2
The time and date at which the code was run: 20210505T14h25
Please run the following code in your environment and include the output:
Wed May 05 2021 14:28:19 GMT+0200 (South Africa Standard Time)
2021/05/05, 14:28:19
-120
// errors (nodejs not browser)
2.29.1
The text was updated successfully, but these errors were encountered:
Ontop of this I get some pretty strange behaviour in terms of false negatives with isValid
test('YYYYMMDD');// true, no errortest('YYYYMMDDHH');// false, with deprecation warningtest('YYYYMMDD HH');// true, no errortest('YYYYMMDD HHmm');// true, no errortest('YYYYMMDD HH mm');// false, with deprecation warningtest('YYYYMMDD [T]');// false, with deprecation warning
the inconsistency is unreal, my actual test case is YYYYMMDD[T]HH[h]mm which it utterly fails on.
rijnhard
changed the title
allow isValid to be used without deprecation warnings
isValid fails to recognise valid date formats
May 5, 2021
rijnhard
changed the title
isValid fails to recognise valid date formats
isValid fails to recognise valid formats
May 5, 2021
Moment.js doesn't have a Chechen (ce) time format support and falls back to Russian, so Notifications are in an incorrect time format. Can this be fixed here?
Describe the bug
I am using moment to test if a user-provided format is correct.
And this always emits a deprecation warning if the format is not correct which is unnecessary.
relates heavily to #2535
and https://stackoverflow.com/questions/44595835/validate-date-format-not-date-string-using-momentjs
To Reproduce
Expected behavior
return false without warning.
Screenshots
If applicable, add screenshots to help explain your problem.
Moment-specific environment
Please run the following code in your environment and include the output:
The text was updated successfully, but these errors were encountered: