文件名称:Javascript日期对象的dateAdd与dateDiff方法
文件大小:31KB
文件格式:PDF
更新时间:2024-02-11 06:36:26
AS asc c
代码如下:Date.prototype.dateAdd = function(interval,number) { var d = this; var k={‘y’:’FullYear’, ‘q’:’Month’, ‘m’:’Month’, ‘w’:’Date’, ‘d’:’Date’, ‘h’:’Hours’, ‘n’:’Minutes’, ‘s’:’Seconds’, ‘ms’:’MilliSeconds’}; var n={‘q’:3, ‘w’:7}; eval(‘d.set’+k[interval]+'(d.get’+k[interval]+'()+’+((n[interval]||1