当前位置:网站首页>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
}边栏推荐
- golang操作redis:写入、读取hash类型数据
- Create your own deep learning environment with CONDA
- Software testing assignment - day 3
- RestHighLevelClient获取某个索引的mapping
- Software testing learning - day one
- The essence of interview
- 利用C#实现Pdf转图片
- Interface test weather API
- Software testing learning - the next day
- Floating menu operation
猜你喜欢

2022-06-23 VGMP-OSPF-域間安全策略-NAT策略(更新中)

2022 East China Normal University postgraduate entrance examination machine test questions - detailed solution

Dbnet: real time scene text detection with differentiable binarization

10000小時定律不會讓你成為編程大師,但至少是個好的起點

(翻译)异步编程:Async/Await在ASP.NET中的介绍

Chapter 8. MapReduce production experience

机器学习 | 简单但是能提升模型效果的特征标准化方法(RobustScaler、MinMaxScaler、StandardScaler 比较和解析)

熊市里的大机构压力倍增,灰度、Tether、微策略等巨鲸会不会成为'巨雷'?

On the practice of performance optimization and stability guarantee

Software testing learning - day one
随机推荐
Machine learning | simple but feature standardization methods that can improve the effect of the model (comparison and analysis of robustscaler, minmaxscaler, standardscaler)
EasyExcel
Create your own deep learning environment with CONDA
Learning notes -- principles and comparison of k-d tree and IKD tree
Jenkins
Journal quotidien des questions (11)
Hands on redis master-slave replication, sentinel master-slave switching, cluster sharding
Integration test practice (1) theoretical basis
pytorch练习小项目
【LeetCode】Day93-两个数组的交集 II
(翻译)异步编程:Async/Await在ASP.NET中的介绍
Yolov2 learning and summary
10万奖金被瓜分,快来认识这位上榜者里的“乘风破浪的姐姐”
Centos切换安装mysql5.7和mysql8.0
Unittest attempt
Climb movie paradise 2021 hot
Class and object summary
The difference between CONDA and pip
10000小时定律不会让你成为编程大师,但至少是个好的起点
Condition annotation in uni-app realizes cross segment compatibility, navigation jump and parameter transfer, component creation and use, and life cycle function