开发者

jquery validate future date

开发者 https://www.devze.com 2022-12-09 14:38 出处:网络
yet I didnt find a jquery function that validate value to be a future 开发者_开发百科date ... help please :) You can do this:

yet I didnt find a jquery function that validate value to be a future 开发者_开发百科date ... help please :)


You can do this:

function isFutureDate() {
    var date = new Date();
    date.setFullYear(2020, 1, 1);
    var _now = new Date();
    if (date.getTime() > _now.getTime()) {
        // date is future
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消