javascript - 如何在 beforeShowDay 中突出显示对象
问题描述
beforeShowDay如何突出显示对象中的值?
- jquery 日期选择器
beforeShowDay: function(date) {
var date = $("#calendar").datepicker({
dateFormat: 'yy-mm-dd'
}).val();
var date = highdate;
console.log(highdate);
console.log(hightext);
var Highlight = highdate[date];
var HighlighText = hightext[date];
if (Highlight) {
return [true, "Highlighted", HighlighText];
} else {
return [true, '', ''];
}
}
2.highdate 对象
Object
0:"2018-04-04"
1:"2018-04-30"
__proto__:Object
3.hightext 对象
Object
0:"text1"
1:"text2"
__proto__:Object
4.css
.Highlighted a {
background-color: Green !important;
background-image: none !important;
color: White !important;
font-weight: bold !important;
font-size: 12pt;
}
解决方案
推荐阅读
- ios - 在 iPhone X 和更早版本中无法返回到以前的视图控制器
- vue.js - node-red 中的自定义 UI(node-red-contrib-uibuilder & VueJS & 导入包)
- java - Jsoup 选择器:h2 之后的第二个 div
- elasticsearch - 在同一集群环境中使用 dockerfile 使用 Kibana 创建 3 个 Elasticsearch 集群和 1 个 Balancer 节点
- datepicker - 如何将引导日期选择器添加到制表符标题过滤器
- javascript - 查询?在正则表达式中 - JAVASCRIPT
- powershell - Powershell FolderBrowserDialog 无法选择外部共享
- reactjs - 为什么 create-react-app 将类型和打字稿放在依赖项而不是开发依赖项中?
- node.js - 从 Docker 连接 Redis 本地主机
- node.js - 谁能帮我解决与passportjs相关的错误