How can I determine whether a given string represents a date?

后端 未结 11 1647
一个人的身影
一个人的身影 2020-12-11 00:31

Is there an isDate function in jQuery?

It should return true if the input is a date, and false otherwise.

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 01:06

    Depending on how you're trying to implement this, you may be able to use the "validate" jQuery plugin with the date option set.

提交回复
热议问题