关于CSS:自定义datepicker主题不适用

Custom datepicker theme not applying

我正在尝试为我的网站启用自定义datepicker主题。现在,我只能使jquery-ui.css主题起作用,但是它们看起来很棒,并且我不想创建自己的新主题。

我访问了此网站:jQuery datepicker皮肤

已经下载了我需要的css文件,但没有任何反应。在github站点的自定义日期选择器的Git站点上,他们说您必须将适当的类添加到日期选择器中,但是不知道这意味着什么。

这是我要使其正常工作所要加载的内容:

1
2
3
4
5
6
7
8
<!-- Jquery Ui script -->
<script src="~/Scripts/jquery-ui.js">

<!-- Datepicker themes -->
<link href="~/Content/jquery-ui.css" rel="stylesheet"/>

<!-- Datepicker melon theme -->
<link href="~/Content/datepicker.css" rel="stylesheet" />

如果我删除了jquery-ui.css文件,则日期选择器仅显示为没有任何主题。


修复了Rahul评论的问题。

添加了以下行:

1
.datepicker('widget').wrap('');

在日期选择器之后。

预览:

1
2
3
4
5
6
7
8
9
10
11
//Initialize datepickers
    $("#departureDate").datepicker({
        dateFormat:"yy-mm-dd",
        inline: true,

    })
    $("#returnDate").datepicker({
        dateFormat:"yy-mm-dd",
        inline: true,
    })
    .datepicker('widget').wrap('');