Files
orico-official-website-old/public/frontend/layui-main/docs/laydate/examples/mark.md
2024-10-29 14:04:59 +08:00

2.2 KiB
Executable File
Raw Blame History

开启公历节日
自定义日子
节假日标注
<script> layui.use(function(){ var laydate = layui.laydate; // 渲染 //开启公历节日 laydate.render({ elem: '#ID-laydate-calendar', calendar: true }); //自定义重要日子 laydate.render({ elem: '#ID-laydate-mark', mark: { '0-10-14': '生日', '0-12-31': '跨年', //每年的日期 '0-0-10': '工资', //每月某天 '0-0-15': '月中', '2017-8-15': '', //如果为空字符,则默认显示数字+徽章 '2099-10-14': '呵呵' }, done: function(value, date){ // 点击每年的 10月14日弹出提示语 if(date.month === 10 && date.date === 14){ layer.msg('这一天是Layui 的生日'); } } }); // 节假日和补班日标注 laydate.render({ elem: '#ID-laydate-holidays', value: '2023-05-08', holidays: [ // v2.7.3 新增 ['2022-12-31', '2023-1-1', '2023-1-2', '2023-1-21', '2023-1-22', '2023-1-23', '2023-1-24', '2023-1-25', '2023-1-26', '2023-1-27', '2023-4-5', '2023-4-29', '2023-4-30', '2023-5-1', '2023-5-2', '2023-5-3', '2023-6-22', '2023-6-23', '2023-6-24', '2023-9-29', '2023-9-30', '2023-10-1', '2023-10-2', '2023-10-3', '2023-10-4', '2023-10-5', '2023-10-6'], // 2023 年的补班日 ['2023-1-28', '2023-1-29', '2023-4-23', '2023-5-6', '2023-6-25', '2023-10-7', '2023-10-8'] ] }); }); </script>