当前位置:网站首页>JS date comparison
JS date comparison
2022-07-03 06:53:00 【God】
if(nowDate() > date){
// yesterday
$("#yesterday").html(htmlStr);
}else if (nowDate() < date){
// Tomorrow,
$("#tomorrow").html(htmlStr);
}else {
// today
$("#today").html(htmlStr);
}
// Today's date
function nowDate(){
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
let day = now.getDate();
if(month < 10){
month = '0'+month;
}
if(day < 10){
day = '0'+day;
}
let nowStr = year +"-"+ month+"-"+day;
return nowStr
}
边栏推荐
- [5g NR] UE registration process
- 保险公司怎么查高血压?
- MATLAB如何修改默认设置
- 10000小時定律不會讓你成為編程大師,但至少是個好的起點
- Yolov1 learning notes
- C2338 Cannot format an argument. To make type T formattable provide a formatter<T> specialization:
- [leetcode] day93 - intersection of two arrays II
- opencv
- New knowledge! The virtual machine network card causes your DNS resolution to slow down
- Daily question brushing record (11)
猜你喜欢
【无标题】
2022年华东师范大学计科考研复试机试题-详细题解
New knowledge! The virtual machine network card causes your DNS resolution to slow down
The list of "I'm crazy about open source" was released in the first week, with 160 developers on the list
每日刷题记录 (十一)
Practical plug-ins in idea
2022 CISP-PTE(三)命令执行
2022 - 06 - 23 vgmp - OSPF - Inter - Domain Security Policy - nat Policy (Update)
On the practice of performance optimization and stability guarantee
第8章、MapReduce 生产经验
随机推荐
Understand software testing
Error c2017: illegal escape sequence
Abstract learning
La loi des 10 000 heures ne fait pas de vous un maître de programmation, mais au moins un bon point de départ
2022-06-23 VGMP-OSPF-域间安全策略-NAT策略(更新中)
On the practice of performance optimization and stability guarantee
2022 - 06 - 23 vgmp - OSPF - Inter - Domain Security Policy - nat Policy (Update)
Paper notes vsalm literature review "a comprehensive survey of visual slam algorithms"
Pytorch exercise items
Derivation of variance iteration formula
crontab定时任务
论文笔记 VSALM 文献综述《A Comprehensive Survey of Visual SLAM Algorithms》
Daily question brushing record (11)
Create your own deep learning environment with CONDA
远端rostopic的本地rviz调用及显示
【开源项目推荐-ColugoMum】这群本科生基于国产深度学习框架PaddlePadddle开源了零售行业解决方案
第8章、MapReduce 生产经验
2022 cisp-pte (III) command execution
Unit test framework + Test Suite
修改MySQL密码