获得徽章 0
- 我朋友公司开源了一个前后端一体的研发框架,可以让我们少干点活,少加会班;有时间可以了解一下,没时间帮我点个star; 在帮我转一下你的研发圈子,感谢!
github
后端:github.com
前端:github.com
Gitee
后端:gitee.com
前端:gitee.com
展开194 - function parse(start, end) {
const diff = end - start;
let tmp = parseInt(diff / 1000);
let target = [];
while (tmp > 0) {
target.push(tmp % 60);
tmp = parseInt(tmp / 60);
}
return target;
}
function getCountdown() {
const last = new Date("2023-09-28 18:00").getTime();
const now = new Date().getTime();
return parse(now, last)
.reverse()
.map(c => (c > 9 ? c : `0${c}`))
.join(":");
}
setInterval(() => {
console.log(`%c 倒计时:%s`, "color: red;font-size: 16px;border: 1px solid red;padding: 4px 12px;border-radius: 4px;", getCountdown());
}, 1000);展开
77
![[流泪]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_6.dde0d83.png)