$(function () {
var data = [
{
time: 1579151050240,
name: 'ES6转ES5',
url: 'http://note.youdao.com/noteshare?id=2ab2aea2da985b3c1e317410a833092b&sub=395E078B340D459F9CF1778A9602FDBD'
},
{
time: 1579151050240,
name: '解构赋值',
url: 'http://note.youdao.com/noteshare?id=8d171b0c923ba7ae13ab6f73ddb43e0b&sub=C6D02B299BCF48B18427A72B5545416D'
},
{
time: 1579151050240,
name: '函数',
url: 'http://note.youdao.com/noteshare?id=1c661be8b3e491d02ae4c23fa28f9c2e&sub=3D5E6170CA5E47A3B561AB60BC084E78'
},
{
time: 1579151050240,
name: '数组',
url: 'http://note.youdao.com/noteshare?id=4e40ca70370d9d4569972aaa0b2909e8&sub=A965EF2915644BE5B8FEA90F6DEBE395'
},
{
time: 1579151050240,
name: '对象',
url: 'http://note.youdao.com/noteshare?id=d6f7ef2fcfdf78f2e9af1ced2530058d&sub=B19ABCCDDF7641FF97D362CC769491A0'
},
{
time: 1579401096394,
name: '微信小程序',
url: 'http://note.youdao.com/noteshare?id=3341892f7ab17003da841f9db91cbe22&sub=6DA4CA0E780A44C0881A8FC2EBF755DC'
}
]
for (let i = 0; i < data.length; i++) {
var mtime = data[i].time;
var nowTime = new Date().getTime();
var needTime = nowTime - mtime;
if (needTime > 24 * 60 * 60 * 1000) {
$('body').append(
'<p><a href=' + data[i].url + '>' + data[i].name + '</a></p>'
)
} else if (needTime > 6 * 24 * 60 * 60 * 1000) {
$('body').append(
'<p><a href=' + data[i].url + '>' + data[i].name + '</a></p>'
)
} else if (needTime > 30 * 24 * 60 * 60 * 1000) {
$('body').append(
'<p><a href=' + data[i].url + '>' + data[i].name + '</a></p>'
)
} else if (needTime > 6 * 30 * 24 * 60 * 60 * 1000) {
$('body').append(
'<p><a href=' + data[i].url + '>' + data[i].name + '</a></p>'
)
} else if (needTime > 12 * 30 * 24 * 60 * 60 * 1000) {
$('body').append(
'<p><a href=' + data[i].url + '>' + data[i].name + '</a></p>'
)
} else if (needTime > 18 * 30 * 24 * 60 * 60 * 1000) {
$('body').append(
'<p><a href=' + data[i].url + '">' + data[i].name + '</a></p>'
)
}
}
})
console