How to validate DateTime format?

前端 未结 7 1833
广开言路
广开言路 2020-12-11 00:53

I am suppose to let the user enter a DateTime format, but I need to validate it to check if it is acceptable. The user might enter \"yyyy-MM-dd\" and it would be fine, but t

7条回答
  •  盖世英雄少女心
    2020-12-11 01:20

    My solution was to mark the input-field as read-only and allow users to change the value only by jqueryui datepicker.

    It is intuitive. You can specify your preferred format and need only to validate this one format.

提交回复
热议问题