IE8: Object Doesn't Support This Property or Method (Date function)

后端 未结 4 1391
忘了有多久
忘了有多久 2021-01-18 06:00

I\'m getting an error that only appears on the great IE8, it points to the following function, specifically the line: return (expDate.getTime() > Date.now());

4条回答
  •  迷失自我
    2021-01-18 06:17

    Shim using the fact valueOf a Date is ms..

    if (!Date.now) Date.now = function () {return +new Date();};
    

提交回复
热议问题