<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>日期</title>
<link href="https://www.layuicdn.com/layui-v2.5.6/css/layui.css" rel="stylesheet" />
<script src="https://lib.baomitu.com/jquery/3.1.0/jquery.min.js "></script>
<script src="layer/layer.js"></script>
<script src="layer/laydate.js"></script>
</head>
<body>
<input type="text" id="biaoti" />
<input type="text" id="biaoti2" />
<input type="text" id="biaoti3" />
<script>
;!function(){
laydate.render({
elem:'#biaoti',
});
laydate.render({
elem:'#biaoti2',
mark:{
'2020-11-11':'购物啦'
},
done: function(x, y){
if(y.year==2020 && y.month==11 && y.date==11){
alert('哈哈,第一次购物成功');
}
}
});
}();
$(function(){
laydate.render({
elem: '#biaoti3'
,mark: {
'0-10-14': '生日'
,'0-12-31': '跨年' //每年的日期
,'0-0-10': '工资' //每月某天
,'0-0-15': '月中'
,'2017-8-15': '' //如果为空字符,则默认显示数字+徽章
,'2099-10-14': '呵呵'
}
,done: function(value, date){
if(date.year === 2017 && date.month === 8 && date.date === 15){ //点击2017年8月15日,弹出提示语
alert('这一天是:中国人民抗日战争胜利72周年');
}
}
});
});
</script>
<script src="https://www.layuicdn.com/layui-v2.5.6/layui.js"></script>
</body>
</html>