如何更改引导日期选择器的选定日期颜色背景? [英] How to change bootstrap datepicker's selected date color background?

查看:415
本文介绍了如何更改引导日期选择器的选定日期颜色背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更改引导日期选择器中所选日期的颜色,并尝试更改日期选择器容器的背景颜色,但是似乎没有可用的选项来更改和自定义.

I am trying to change the color of selected date in bootstrap datepicker and tried changing the background color of datepicker container but there seems to be no options available to change and customize.

请让我知道是否有任何可用于自定义日历设计的内容.

Please let me know if anything available to customize the calendar design.

 $('#date_of_completion').datepicker({
        format: 'dd/mm/yyyy',
        autoclose: true
    });

推荐答案

您有2种可能性这样做

1)根据项目较少的文件编译自己的样式,并以较少的内容覆盖背景颜色:

1) Compile your own style based on the projects less files and override the background color in less:

这是您应该覆盖的课程

&.active,
&.active.highlighted {
    .button-variant(@btn-primary-color, @btn-primary-bg, @btn-primary-border);
    text-shadow: 0 -1px 0 rgba(0,0,0,.25);
}

请参见 datepicker3.less第170行

2)覆盖已编译的CSS类

2) Override the compiled css class

.datepicker table tr td.active:active, 
.datepicker table tr td.active.highlighted:active, 
.datepicker table tr td.active.active, 
.datepicker table tr td.active.highlighted.active {
   background-color: green;
}

请参见示例

这篇关于如何更改引导日期选择器的选定日期颜色背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆