dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

[isValid] function not works properly.

Open heuhiu opened this issue 2 years ago • 1 comments

Describe the bug How the hell on earth with any string + one random number at the end with space -> the .isValid() is still return true dayjs(what_ever_string_you_input 999).isValid()) -> true ?

Expected behavior It should return false instead.

Information

  • Day.js Version in "Antd": "^5.9.1", -> maybe need check with Antd
  • OS: window
  • Browser: Edge Version 119.0.2151.44 (Official build) (64-bit)
  • Time zone: GMT+7

heuhiu avatar Nov 07 '23 01:11 heuhiu

This! It makes no sense. The same happens with the native JS Date object.

ljgaro avatar Feb 02 '24 21:02 ljgaro

Facing same issue. Any update?

Dharmang92 avatar Feb 28 '24 11:02 Dharmang92

This works properly in date-fns: https://github.com/date-fns/date-fns/tree/main/src/isValid

Dharmang92 avatar Feb 28 '24 11:02 Dharmang92