当前位置:网站首页>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
}边栏推荐
- Derivation of variance iteration formula
- Class and object summary
- 【LeetCode】Day93-两个数组的交集 II
- Heap sort and priority queue
- Yolov3 learning notes
- Resttemplate configuration use
- Condition annotation in uni-app realizes cross segment compatibility, navigation jump and parameter transfer, component creation and use, and life cycle function
- mysql误删root账户导致无法登录
- Know flex box
- 【开源项目推荐-ColugoMum】这群本科生基于国产深度学习框架PaddlePadddle开源了零售行业解决方案
猜你喜欢

Dbnet: real time scene text detection with differentiable binarization

2022-06-23 vgmp OSPF inter domain security policy NAT policy (under update)

Software testing learning - day 3

利用C#实现Pdf转图片

2022 - 06 - 23 vgmp - OSPF - Inter - Domain Security Policy - nat Policy (Update)

100000 bonus is divided up. Come and meet the "sister who braves the wind and waves" among the winners

Practical plug-ins in idea

On the practice of performance optimization and stability guarantee

Scroll view specifies the starting position of the scrolling element

SSH link remote server and local display of remote graphical interface
随机推荐
The difference between CONDA and pip
opencv
【开源项目推荐-ColugoMum】这群本科生基于国产深度学习框架PaddlePadddle开源了零售行业解决方案
Error c2017: illegal escape sequence
每日刷题记录 (十一)
10万奖金被瓜分,快来认识这位上榜者里的“乘风破浪的姐姐”
第8章、MapReduce 生产经验
Pytest -- write and manage test cases
Interface test weather API
The essence of interview
Journal quotidien des questions (11)
2021 year end summary
Personally design a highly concurrent seckill system
【无标题】
opencv
IC_ EDA_ All virtual machine (rich Edition): questasim, vivado, VCs, Verdi, DC, Pt, spyglass, icc2, synthesize, innovative, ic617, mmsim, process library
Resttemplate configuration use
2022-06-23 vgmp OSPF inter domain security policy NAT policy (under update)
The list of "I'm crazy about open source" was released in the first week, with 160 developers on the list
2022年华东师范大学计科考研复试机试题-详细题解