validate end date equal to greater than start date

前端 未结 2 1436
清酒与你
清酒与你 2021-01-20 20:52

I want to check whether end date is greater than or equal to start date, with jquery validate. It is validating end date greater than start date, but it is not permitting en

2条回答
  •  天涯浪人
    2021-01-20 21:35

    You should use is greater than or equal to(>=) in your custom method greaterThan.

    Change this line:

    return new Date(value) > new Date($(params).val());
    

    To:

    return new Date(value) >= new Date($(params).val());
    

    Enjoy...

提交回复
热议问题