let current = new Date(); //当前日期
current.setDate(current.getDate() - 14); //获取14天前的日期
let y = current.getFullYear();
let m =
current.getMonth() + 1 < 10
? "0" + (current.getMonth() + 1)
: current.getMonth() + 1; //获取当前月份的日期,不足10补0
let d =
current.getDate() < 10 ? "0" + current.getDate() : current.getDate();
let before14 = `${y}-${m}-${d}`;
版权声明:本文为weixin_38747509原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。