查看对象是否为日期 (包含字符串 "Date"):

function isDate(myDate) {
    return myDate.constructor.toString().indexOf("Date") > -1;
}

posted @ 2021-08-11 08:36  柳仙慧子  阅读(60)  评论(0编辑  收藏  举报